Mix: Swallow git error messages during version number handling.

Otherwise sometimes a 'fatal' message will be printed, confusing users.
This commit is contained in:
lain 2019-06-04 16:44:56 +02:00
parent 0eb7464c10
commit b5e3b1e58a

View file

@ -157,7 +157,8 @@ defp aliases do
# * the mix environment if different than prod # * the mix environment if different than prod
defp version(version) do defp version(version) do
{git_tag, git_pre_release} = {git_tag, git_pre_release} =
with {tag, 0} <- System.cmd("git", ["describe", "--tags", "--abbrev=0"]), with {tag, 0} <-
System.cmd("git", ["describe", "--tags", "--abbrev=0"], stderr_to_stdout: true),
tag = String.trim(tag), tag = String.trim(tag),
{describe, 0} <- System.cmd("git", ["describe", "--tags", "--abbrev=8"]), {describe, 0} <- System.cmd("git", ["describe", "--tags", "--abbrev=8"]),
describe = String.trim(describe), describe = String.trim(describe),