Include git hash in http headers and <meta> tags.
* Add X-Git-Hash http header. * Add `<meta name="git-hash" content="<hash>">` meta tag. * Include full hash in development mode.
This commit is contained in:
@@ -50,7 +50,7 @@ module Danbooru
|
||||
if File.exist?("#{config.root}/REVISION")
|
||||
config.x.git_hash = File.read("#{config.root}/REVISION").strip
|
||||
elsif system("type git > /dev/null && git rev-parse --show-toplevel > /dev/null")
|
||||
config.x.git_hash = `git rev-parse --short HEAD`.strip
|
||||
config.x.git_hash = `git rev-parse HEAD`.strip
|
||||
else
|
||||
config.x.git_hash = nil
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user