1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-26 17:59:26 +00:00
mobilizon/lib/service/git_status.ex
Thomas Citharel f5241954bd
Improve Terms of Service
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2020-06-23 10:35:15 +02:00

21 lines
515 B
Elixir

defmodule Mobilizon.Service.GitStatus do
@moduledoc """
See https://github.com/CrowdHailer/git_status/
"""
require Logger
@commit (case System.cmd("git", ["describe", "--tags", "--dirty"]) do
{hash, 0} ->
String.trim(hash)
_ ->
Logger.warn("Could not read git commit hash")
"UNKNOWN"
end)
@doc """
The git commit hash read at compile time, if present
"""
@spec commit :: String.t()
def commit, do: @commit
end