diff --git a/app/views/spree/admin/overview/_version.html.haml b/app/views/spree/admin/overview/_version.html.haml index 729d0a3fe8..d9f5076ddc 100644 --- a/app/views/spree/admin/overview/_version.html.haml +++ b/app/views/spree/admin/overview/_version.html.haml @@ -1,3 +1,3 @@ %a{href:"https://github.com/openfoodfoundation/openfoodnetwork/releases", target: "_blank", title: t('.view_all_releases')} =# Show the latest tag. If there are commits since the tag, show number of commits and an identifier. If the working tree is dirty, show 'modified'. - = `git describe --tags --dirty=-modified` + = Rails.application.config.x.git_version diff --git a/config/application.rb b/config/application.rb index c3cb2db1c5..bb13b4dd50 100644 --- a/config/application.rb +++ b/config/application.rb @@ -34,6 +34,9 @@ end module Openfoodnetwork class Application < Rails::Application + # Store a description of the current version, with linebreak trimmed + config.x.git_version = `git describe --tags --dirty=-modified`.strip + config.after_initialize do # We need this here because the test env file loads before the Spree engine is loaded Spree::Core::Engine.routes.default_url_options[:host] = ENV["SITE_URL"] if Rails.env == 'test'