Skip to content

Commit

Permalink
fix: configure BLOCKSCOUT_VERSION in a standard way
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Feb 21, 2019
1 parent 5b7567e commit fb68e8f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
3 changes: 2 additions & 1 deletion apps/block_scout_web/config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
9 changes: 1 addition & 8 deletions apps/block_scout_web/lib/block_scout_web.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fb68e8f

Please sign in to comment.