Skip to content

Commit

Permalink
Apply better elixir conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
arbulu89 committed Aug 1, 2022
1 parent 13319a8 commit ce04477
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@ defmodule Trento.MixProject do
use Mix.Project

@version "1.1.0"
defp get_version do
case System.get_env("VERSION") do
nil -> get_version_from_git()
version -> version
end
end

defp get_version_from_git do
case File.cwd!() |> Path.join("hack/get_version_from_git.sh") |> System.cmd([]) do
{version, 0} -> version |> String.trim("\n")
_ -> @version
end
end

def project do
[
Expand Down Expand Up @@ -136,4 +123,14 @@ defmodule Trento.MixProject do
]
]
end

defp get_version, do:
System.get_env("VERSION", get_version_from_git())

defp get_version_from_git do
case File.cwd!() |> Path.join("hack/get_version_from_git.sh") |> System.cmd([]) do
{version, 0} -> version |> String.trim("\n")
_ -> @version
end
end
end

0 comments on commit ce04477

Please sign in to comment.