[#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.
This commit is contained in:
Felix Schäfer 2011-12-03 17:39:52 +01:00
parent 6a616a5f13
commit d943efd0eb
1 changed files with 1 additions and 6 deletions

View File

@ -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