Skip to content

Commit fad5d37

Browse files
authored
[Broadcaster] Add footer with version number (#16)
1 parent 97c68d7 commit fad5d37

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

broadcaster/lib/broadcaster/application.ex

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@ defmodule Broadcaster.Application do
55

66
use Application
77

8+
@version Mix.Project.config()[:version]
9+
10+
@spec version() :: String.t()
11+
def version() do
12+
"v#{@version} #{commit()}"
13+
end
14+
15+
defp commit() do
16+
case System.cmd("git", ["rev-parse", "--short", "HEAD"]) do
17+
{hash, 0} -> "(#{String.trim(hash)})"
18+
_ -> ""
19+
end
20+
end
21+
822
@impl true
923
def start(_type, _args) do
1024
children = [

broadcaster/lib/broadcaster_web/components/layouts/app.html.heex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,6 @@ See https://stackoverflow.com/a/36247448/9620900
4545
<%= @inner_content %>
4646
</div>
4747
</main>
48+
<footer class="flex flex-row px-4 py-2 lg:justify-start justify-center font-semibold text-brand/80">
49+
<%= Broadcaster.Application.version() %>
50+
</footer>

0 commit comments

Comments
 (0)