Link current commit if running inside a git repo.
Useful when running `rails server` straight from a dev repo.
This commit is contained in:
@@ -24,6 +24,8 @@ module Danbooru
|
|||||||
|
|
||||||
if File.exists?("#{config.root}/REVISION")
|
if File.exists?("#{config.root}/REVISION")
|
||||||
config.x.git_hash = File.read("#{config.root}/REVISION").strip
|
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
|
else
|
||||||
config.x.git_hash = nil
|
config.x.git_hash = nil
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user