summaryrefslogtreecommitdiff
path: root/lib/nola.ex
blob: 51c2150143141e913731b8d02eb32fab22d3b299 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
defmodule Nola do

  @default_brand [
    name: "Nola",
    source_url: "https://phab.random.sh/source/Nola/",
    owner: "Ashamed owner",
    owner_email: "contact@my.nola.bot"
  ]

  def env(), do: Application.get_env(:nola)
  def env(key, default \\ nil), do: Application.get_env(:nola, key, default)

  def brand(), do: env(:brand, @default_brand)
  def brand(key), do: Keyword.get(brand(), key)
  def name(), do: brand(:name)
  def source_url(), do: brand(:source_url)

  def data_path(suffix) do
    Path.join(data_path(), suffix)
  end

  def data_path do
    Application.get_env(:nola, :data_path)
  end

  def version do
    Application.spec(:nola)[:vsn]
  end

end