Created
September 10, 2019 21:54
-
-
Save dougo-chris/f358b42ea1dd5a5497a7e893fd276e55 to your computer and use it in GitHub Desktop.
Updating Elixir Versions with git sha
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule MyApp.App.Mixfile do | |
use Mix.Project | |
def project do | |
[ | |
app: :my_app, | |
version: "0.0.1-#{sha()}", | |
... | |
def sha do | |
case System.cmd("git", ["rev-parse", "HEAD"]) do | |
{tag, 0} -> | |
String.trim(tag) | |
_ -> | |
"UNKNOWN" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment