Link current commit if running inside a git repo.

Useful when running `rails server` straight from a dev repo.
This commit is contained in:
evazion 2016-10-24 19:02:06 -05:00
parent 0757f201a0
commit 58ef469a76

View File

@ -24,6 +24,8 @@ module Danbooru
if File.exists?("#{config.root}/REVISION")
config.x.git_hash = File.read("#{config.root}/REVISION").strip
elsif system("type git && git rev-parse --show-toplevel")
config.x.git_hash = %x(git rev-parse --short HEAD).strip
else
config.x.git_hash = nil
end