mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
clean up git version stuff a tad
This commit is contained in:
parent
5265c0b790
commit
0e48e1c346
3 changed files with 6 additions and 5 deletions
|
@ -58,6 +58,6 @@
|
||||||
<%= render :partial => "common/discourse_javascript" %>
|
<%= render :partial => "common/discourse_javascript" %>
|
||||||
<%= render_google_analytics_code %>
|
<%= render_google_analytics_code %>
|
||||||
|
|
||||||
<!-- Git Version: <%= $git_version %> -->
|
<!-- Git Version: <%= Discourse.git_version %> -->
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
require File.expand_path('../boot', __FILE__)
|
require File.expand_path('../boot', __FILE__)
|
||||||
# our version info can be missing, we will do our best to figure it out
|
|
||||||
require File.expand_path('../version', __FILE__) rescue nil
|
|
||||||
|
|
||||||
require 'rails/all'
|
require 'rails/all'
|
||||||
require 'redis-store' # HACK
|
require 'redis-store' # HACK
|
||||||
|
|
||||||
|
|
|
@ -45,8 +45,12 @@ module Discourse
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.git_version
|
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
|
begin
|
||||||
$git_version ||= `git rev-parse HEAD`
|
$git_version ||= `git rev-parse HEAD`.strip
|
||||||
rescue
|
rescue
|
||||||
$git_version = "unknown"
|
$git_version = "unknown"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue