mirror of
https://github.com/discourse/discourse.git
synced 2025-02-17 01:32:44 +08:00
Version checks include the branch
This commit is contained in:
parent
b2460d7395
commit
19cba7bb0f
|
@ -201,6 +201,16 @@ module Discourse
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.git_branch
|
||||||
|
return $git_branch if $git_branch
|
||||||
|
|
||||||
|
begin
|
||||||
|
$git_branch ||= `git rev-parse --abbrev-ref HEAD`.strip
|
||||||
|
rescue
|
||||||
|
$git_branch = "unknown"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Either returns the site_contact_username user or the first admin.
|
# Either returns the site_contact_username user or the first admin.
|
||||||
def self.site_contact_user
|
def self.site_contact_user
|
||||||
user = User.find_by(username_lower: SiteSetting.site_contact_username.downcase) if SiteSetting.site_contact_username.present?
|
user = User.find_by(username_lower: SiteSetting.site_contact_username.downcase) if SiteSetting.site_contact_username.present?
|
||||||
|
|
|
@ -6,10 +6,9 @@ module DiscourseHub
|
||||||
def self.version_check_payload
|
def self.version_check_payload
|
||||||
{
|
{
|
||||||
installed_version: Discourse::VERSION::STRING
|
installed_version: Discourse::VERSION::STRING
|
||||||
}
|
}.merge!( Discourse.git_branch == "unknown" ? {} : {branch: Discourse.git_branch})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def self.discourse_version_check
|
def self.discourse_version_check
|
||||||
get('/version_check', version_check_payload)
|
get('/version_check', version_check_payload)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user