Read version from file

This commit is contained in:
Adrian Kumpf
2020-10-04 19:09:17 +02:00
parent 8adadaf724
commit ca11558992
4 changed files with 18 additions and 7 deletions
+8 -1
View File
@@ -4,7 +4,7 @@ defmodule TeslaMate.MixProject do
def project do
[
app: :teslamate,
version: "1.20.0",
version: version(),
elixir: "~> 1.10",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
@@ -81,4 +81,11 @@ defmodule TeslaMate.MixProject do
]
]
end
defp version do
case File.read("VERSION") do
{:ok, version} -> String.trim(version)
{:error, _reason} -> "0.0.0"
end
end
end