diff options
author | href <href@random.sh> | 2022-12-11 12:51:27 +0000 |
---|---|---|
committer | href <href@random.sh> | 2022-12-11 12:51:27 +0000 |
commit | 5df2109a3c0e4545e46707ef15e013ce49292bbf (patch) | |
tree | d70741f0dda95e493578102898e9a163549fa733 | |
parent | feat(telegram): replace dets by couch for room settings (diff) |
chore: git url, extend version number and improve reporting
- appends `.build%y%m%d@%H%M` to version
- more info & runtime version in `!version`
- `LSG.source_url()` to get the git url instead of hardcodes
-rw-r--r-- | lib/lsg/lsg.ex | 4 | ||||
-rw-r--r-- | lib/lsg_irc/base_plugin.ex | 11 | ||||
-rw-r--r-- | lib/lsg_web/templates/irc/index.html.eex | 2 | ||||
-rw-r--r-- | mix.exs | 3 |
4 files changed, 16 insertions, 4 deletions
diff --git a/lib/lsg/lsg.ex b/lib/lsg/lsg.ex index dc0f641..25f127f 100644 --- a/lib/lsg/lsg.ex +++ b/lib/lsg/lsg.ex @@ -1,5 +1,9 @@ defmodule LSG do + def source_url() do + "https://git.random.sh/ircbot.git" + end + def data_path(suffix) do Path.join(data_path(), suffix) end diff --git a/lib/lsg_irc/base_plugin.ex b/lib/lsg_irc/base_plugin.ex index a95f45c..d5da532 100644 --- a/lib/lsg_irc/base_plugin.ex +++ b/lib/lsg_irc/base_plugin.ex @@ -96,8 +96,15 @@ defmodule LSG.IRC.BasePlugin do {:ok, vsn} = :application.get_key(:lsg, :vsn) ver = List.to_string(vsn) url = LSGWeb.Router.Helpers.irc_url(LSGWeb.Endpoint, :index) - version = "v#{ver} ; #{url} ; source: https://git.yt/115ans/sys" - message.replyfun.(version) + elixir_ver = Application.started_applications() |> List.keyfind(:elixir, 0) |> elem(2) |> to_string() + otp_ver = :erlang.system_info(:system_version) |> to_string() |> String.trim() + system = :erlang.system_info(:system_architecture) |> to_string() + message.replyfun.([ + <<"🤖 I am a robot running", 2, "beautte, version #{ver}", 2, " — source: #{LSG.source_url()}, + "🦾 Elixir #{elixir_ver} #{otp_ver} on #{system}" + "👷♀️ Owner: href <href@random.sh>", + "🌍 Web interface: #{url}" + ]) {:noreply, nil} end diff --git a/lib/lsg_web/templates/irc/index.html.eex b/lib/lsg_web/templates/irc/index.html.eex index 52372b5..6cc3128 100644 --- a/lib/lsg_web/templates/irc/index.html.eex +++ b/lib/lsg_web/templates/irc/index.html.eex @@ -39,6 +39,6 @@ <p> <small> - source: <a href="https://git.yt/115ans/sys">git.yt/115ans/sys</a> + running beautte version <%= LSG.version() %> — <a href="<%= LSG.source_url() %>">git</a> </small> </p> @@ -89,8 +89,9 @@ defmodule LSG.Mixfile do Mix.env() == :prod -> "" true -> "." <> to_string(Mix.env()) end + build_date_tag = Timex.format!(DateTime.utc_now(), ".build%y%m%d@%H%M", :strftime) - v <> "+" <> info <> env + v <> "+" <> info <> env <> <> build_date_tag end end |