From a6e45be2181ed7e281cdc90a6677ad3a28599f4e Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Fri, 22 Jul 2022 09:18:33 -0300 Subject: [PATCH] chore(mix): add prefix to pre-release version to please elixir version parser Since upstream refuses to fix this issue: https://github.com/elixir-lang/elixir/issues/12000 On rare occasions, our pre-release version, which is the prefix of the git hash, might consist only of digits. Even more rarely, it might start with a `0`. When that happens, Elixir will refuse to parse that as a valid pre-release version (it wants it to be an integer without a leading 0). To prevent that, we will always prepend a "g" to the pre-release version, ensuring it's never a valid number. --- pkg-vsn.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg-vsn.sh b/pkg-vsn.sh index 7e5c44d27..7f50f03e2 100755 --- a/pkg-vsn.sh +++ b/pkg-vsn.sh @@ -101,7 +101,7 @@ if [ "$GIT_EXACT_VSN" != '' ]; then fi SUFFIX='' else - SUFFIX="-$(git rev-parse HEAD | cut -b1-8)" + SUFFIX="-g$(git rev-parse HEAD | cut -b1-8)" fi PKG_VSN="${PKG_VSN:-${RELEASE}${SUFFIX}}"