From fb68e8ffdf52d1ee8ceec53dc6a4bc4690193280 Mon Sep 17 00:00:00 2001 From: zachdaniel Date: Thu, 21 Feb 2019 11:16:39 -0500 Subject: [PATCH] fix: configure BLOCKSCOUT_VERSION in a standard way --- apps/block_scout_web/config/config.exs | 3 ++- apps/block_scout_web/lib/block_scout_web.ex | 9 +-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/apps/block_scout_web/config/config.exs b/apps/block_scout_web/config/config.exs index 6b5d1fcd0d..60cc509a83 100644 --- a/apps/block_scout_web/config/config.exs +++ b/apps/block_scout_web/config/config.exs @@ -8,7 +8,8 @@ use Mix.Config # General application configuration config :block_scout_web, namespace: BlockScoutWeb, - ecto_repos: [Explorer.Repo] + ecto_repos: [Explorer.Repo], + version: System.get_env("BLOCKSCOUT_VERSION") config :block_scout_web, BlockScoutWeb.Chain, network: System.get_env("NETWORK"), diff --git a/apps/block_scout_web/lib/block_scout_web.ex b/apps/block_scout_web/lib/block_scout_web.ex index 68ff0c002e..9a4c6cab09 100644 --- a/apps/block_scout_web/lib/block_scout_web.ex +++ b/apps/block_scout_web/lib/block_scout_web.ex @@ -16,14 +16,7 @@ defmodule BlockScoutWeb do below. Instead, define any helper function in modules and import those modules here. """ - - # This is intentionally compiled in. Version is set - # at compile time, and we don't want to make a system - # env call to retreive it every time anyone loads any - # page. - @version System.get_env("BLOCKSCOUT_VERSION") || "unknown" - - def version(), do: @version + def version(), do: Application.get_env(:block_scout_web, :version) def controller do quote do