Commit d943efd0 authored by Felix Schäfer's avatar Felix Schäfer

[#748] Make ChiliProject::Version.revision more resilient

* Won't output errors when the ChiliProject git repo isn't there anymore,
* Works even if not invoked from the ChiliProject root directory,
* Moved the formatting logic to the git call.
parent 6a616a5f
......@@ -38,12 +38,7 @@ module ChiliProject
end
def self.revision
revision = `git rev-parse HEAD`
if revision.present?
revision.strip[0..8]
else
nil
end
`git --git-dir="#{Rails.root.join('.git')}" rev-parse --short=9 HEAD`.chomp if File.directory? Rails.root.join('.git')
end
REVISION = self.revision
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment