mirror of
https://github.com/teslamate-org/teslamate.git
synced 2026-01-24 21:06:08 +08:00
Read version from file
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user