Remove calls to Mix as it is not available in releases

This commit is contained in:
Timothée Floure 2021-01-13 17:36:14 +01:00
parent 71ac6d1c27
commit f0e08243d2
Signed by: tfloure
GPG Key ID: 4502C902C00A1E12
3 changed files with 10 additions and 2 deletions

View File

@ -6,4 +6,12 @@ defmodule RecycledCloud do
Contexts are also responsible for managing your data, regardless
if it comes from the database, an external API or others.
"""
# Mix is not available in releases, and these things are static
# anyway (@variables are evaluated at compile time).
@version Mix.Project.config[:version]
@env Mix.env
def version, do: @version
def env, do: @env
end

View File

@ -69,7 +69,7 @@ defmodule RecycledCloudWeb.Router do
# In-memory mailer for development purposes only.
# See https://hexdocs.pm/bamboo/Bamboo.SentEmailViewerPlug.html for details.
if Mix.env == :dev do
if RecycledCloud.env() == :dev do
forward "/outbox", Bamboo.SentEmailViewerPlug
end
end

View File

@ -15,7 +15,7 @@
<img id="nav-logo" src="<%= Routes.static_path(@conn, "/images/cloud.svg") %>"></img>
<p class="nav-notice">
<small>
management v<%= Mix.Project.config[:version] %> | <%= Mix.env %> | <a href="https://code.recycled.cloud/e-Durable/management">sources</a>
management v<%= RecycledCloud.version() %> | <%= RecycledCloud.env() %> | <a href="https://code.recycled.cloud/e-Durable/management">sources</a>
</small>
</p>
</div>