mix.exs: Fix for MacOS
This commit is contained in:
parent
c906ffc51a
commit
b429a49504
1 changed files with 25 additions and 18 deletions
13
mix.exs
13
mix.exs
|
@ -220,14 +220,17 @@ defmodule Pleroma.Mixfile do
|
||||||
defp version(version) do
|
defp version(version) do
|
||||||
identifier_filter = ~r/[^0-9a-z\-]+/i
|
identifier_filter = ~r/[^0-9a-z\-]+/i
|
||||||
|
|
||||||
# Pre-release version, denoted from patch version with a hyphen
|
{_gitpath, git_present} = System.cmd("sh", ["-c", "command -v git"])
|
||||||
|
|
||||||
|
git_pre_release =
|
||||||
|
if git_present do
|
||||||
{tag, tag_err} =
|
{tag, tag_err} =
|
||||||
System.cmd("git", ["describe", "--tags", "--abbrev=0"], stderr_to_stdout: true)
|
System.cmd("git", ["describe", "--tags", "--abbrev=0"], stderr_to_stdout: true)
|
||||||
|
|
||||||
{describe, describe_err} = System.cmd("git", ["describe", "--tags", "--abbrev=8"])
|
{describe, describe_err} = System.cmd("git", ["describe", "--tags", "--abbrev=8"])
|
||||||
{commit_hash, commit_hash_err} = System.cmd("git", ["rev-parse", "--short", "HEAD"])
|
{commit_hash, commit_hash_err} = System.cmd("git", ["rev-parse", "--short", "HEAD"])
|
||||||
|
|
||||||
git_pre_release =
|
# Pre-release version, denoted from patch version with a hyphen
|
||||||
cond do
|
cond do
|
||||||
tag_err == 0 and describe_err == 0 ->
|
tag_err == 0 and describe_err == 0 ->
|
||||||
describe
|
describe
|
||||||
|
@ -242,10 +245,14 @@ defmodule Pleroma.Mixfile do
|
||||||
true ->
|
true ->
|
||||||
""
|
""
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
""
|
||||||
|
end
|
||||||
|
|
||||||
# Branch name as pre-release version component, denoted with a dot
|
# Branch name as pre-release version component, denoted with a dot
|
||||||
branch_name =
|
branch_name =
|
||||||
with {branch_name, 0} <- System.cmd("git", ["rev-parse", "--abbrev-ref", "HEAD"]),
|
with true <- git_present,
|
||||||
|
{branch_name, 0} <- System.cmd("git", ["rev-parse", "--abbrev-ref", "HEAD"]),
|
||||||
branch_name <- String.trim(branch_name),
|
branch_name <- String.trim(branch_name),
|
||||||
branch_name <- System.get_env("PLEROMA_BUILD_BRANCH") || branch_name,
|
branch_name <- System.get_env("PLEROMA_BUILD_BRANCH") || branch_name,
|
||||||
true <-
|
true <-
|
||||||
|
|
Loading…
Reference in a new issue