better mechanism for determining release revision

This commit is contained in:
r888888888
2016-09-07 18:51:25 -07:00
parent af60ed7763
commit 06ddb16843
2 changed files with 8 additions and 2 deletions

View File

@@ -1,6 +1,8 @@
<footer id="page-footer">
Running Danbooru <%= link_to "v#{Danbooru.config.version}", "https://github.com/r888888888/danbooru/releases" %>
(<%= Rails.application.config.x.git_hash %>)
<% if Rails.application.config.x.git_hash %>
(<%= Rails.application.config.x.git_hash %>)
<% end %>
&ndash; <%= link_to "Rules", terms_of_service_path %>
&ndash; <%= link_to "Contact", contact_path %>
<% if CurrentUser.user.enable_post_navigation %>

View File

@@ -22,7 +22,11 @@ module Danbooru
config.log_tags = [lambda {|req| "PID:#{Process.pid}"}]
config.active_record.raise_in_transactional_callbacks = true
config.x.git_hash = `git rev-parse --short HEAD`.strip
if File.exists?("#{config.root}/REVISION")
config.x.git_hash = File.read("#{config.root}/REVISION").strip
else
config.x.git_hash = nil
end
end
I18n.enforce_available_locales = false