mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 21:21:19 +08:00
clean up git version stuff a tad
This commit is contained in:
@ -45,8 +45,12 @@ module Discourse
|
||||
end
|
||||
|
||||
def self.git_version
|
||||
return $git_version if $git_version
|
||||
f = Rails.root.to_s + "/config/version"
|
||||
require f if File.exists?("#{f}.rb")
|
||||
|
||||
begin
|
||||
$git_version ||= `git rev-parse HEAD`
|
||||
$git_version ||= `git rev-parse HEAD`.strip
|
||||
rescue
|
||||
$git_version = "unknown"
|
||||
end
|
||||
|
Reference in New Issue
Block a user