summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Bracco <href@random.sh>2022-12-20 19:37:12 +0100
committerJordan Bracco <href@random.sh>2022-12-20 19:37:12 +0100
commit98135657207190141bea41d0302eada0defdc2cb (patch)
tree122f0a01f98f1a81962a8add417a0ef310c4d138
parentfix version generation when branches have a slash in their name (diff)
Compile fixes, refs T77.
-rw-r--r--lib/irc.ex2
-rw-r--r--lib/nola.ex2
-rw-r--r--lib/nola/message.ex2
-rw-r--r--lib/nola/trigger.ex2
-rw-r--r--mix.exs14
5 files changed, 15 insertions, 7 deletions
diff --git a/lib/irc.ex b/lib/irc.ex
index 0fa1b79..8d04d50 100644
--- a/lib/irc.ex
+++ b/lib/irc.ex
@@ -15,7 +15,7 @@ defmodule Nola.Irc do
end
end
- def admin?(%Message{sender: sender}), do: admin?(sender)
+ def admin?(%Nola.Message{sender: sender}), do: admin?(sender)
def admin?(%{nick: nick, user: user, host: host}) do
for {n, u, h} <- Nola.Irc.env(:admins, []) do
diff --git a/lib/nola.ex b/lib/nola.ex
index 18e5ddd..51c2150 100644
--- a/lib/nola.ex
+++ b/lib/nola.ex
@@ -1,7 +1,7 @@
defmodule Nola do
@default_brand [
- name: "Nola,
+ name: "Nola",
source_url: "https://phab.random.sh/source/Nola/",
owner: "Ashamed owner",
owner_email: "contact@my.nola.bot"
diff --git a/lib/nola/message.ex b/lib/nola/message.ex
index 4ceb9b9..b4e76da 100644
--- a/lib/nola/message.ex
+++ b/lib/nola/message.ex
@@ -1,4 +1,4 @@
-defmodule Message do
+defmodule Nola.Message do
@moduledoc """
Well, a message!
diff --git a/lib/nola/trigger.ex b/lib/nola/trigger.ex
index b6502c3..1dec9ac 100644
--- a/lib/nola/trigger.ex
+++ b/lib/nola/trigger.ex
@@ -1,4 +1,4 @@
-defmodule Trigger do
+defmodule Nola.Trigger do
@moduledoc "A `Nola.Message` parsed command/trigger."
@derive Poison.Encoder
diff --git a/mix.exs b/mix.exs
index 2fd32d0..54af7a8 100644
--- a/mix.exs
+++ b/mix.exs
@@ -83,14 +83,22 @@ defmodule Nola.Mixfile do
defp version(v) do
{describe, 0} = System.cmd("git", ~w(describe --dirty --broken --all --tags --long))
+
[_, rest] = String.split(describe, "/", parts: 2)
- info = String.trim(rest)
+ info = rest
+ |> String.trim()
+ |> String.replace("/", "-")
+
env = cond 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)
- build_date_tag = ".build"
+
+ build_timestamp = DateTime.utc_now()
+ |> DateTime.to_unix()
+ |> to_string()
+
+ build_date_tag = ".build" <> build_timestamp
v <> "+" <> info <> env <> build_date_tag
end