summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>2022-02-25 10:31:42 +0100
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>2022-02-25 10:39:12 +0100
commit56197192bb03058fda375767cc8ffc35c0c9eed0 (patch)
treea6b2020288d6d3ae6e6730d34985f907f8cce0dd
parentd91e9cee04f2e4cb809037e4fcfebc295994b563 (diff)
mix: Check .git presencebugfix/mix-dotgit
-rw-r--r--mix.exs4
1 files changed, 3 insertions, 1 deletions
diff --git a/mix.exs b/mix.exs
index 4387cb0aa..7893b8438 100644
--- a/mix.exs
+++ b/mix.exs
@@ -243,9 +243,10 @@ defmodule Pleroma.Mixfile do
identifier_filter = ~r/[^0-9a-z\-]+/i
git_available? = match?({_output, 0}, System.cmd("sh", ["-c", "command -v git"]))
+ dotgit_present? = File.exists?(".git")
git_pre_release =
- if git_available? do
+ if git_available? and dotgit_present? do
{tag, tag_err} =
System.cmd("git", ["describe", "--tags", "--abbrev=0"], stderr_to_stdout: true)
@@ -272,6 +273,7 @@ defmodule Pleroma.Mixfile do
# Branch name as pre-release version component, denoted with a dot
branch_name =
with true <- git_available?,
+ true <- dotgit_present?,
{branch_name, 0} <- System.cmd("git", ["rev-parse", "--abbrev-ref", "HEAD"]),
branch_name <- String.trim(branch_name),
branch_name <- System.get_env("PLEROMA_BUILD_BRANCH") || branch_name,