mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -05:00
Version checks include the branch
This commit is contained in:
parent
b2460d7395
commit
19cba7bb0f
2 changed files with 11 additions and 2 deletions
|
@ -201,6 +201,16 @@ module Discourse
|
|||
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.
|
||||
def self.site_contact_user
|
||||
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
|
||||
{
|
||||
installed_version: Discourse::VERSION::STRING
|
||||
}
|
||||
}.merge!( Discourse.git_branch == "unknown" ? {} : {branch: Discourse.git_branch})
|
||||
end
|
||||
|
||||
|
||||
def self.discourse_version_check
|
||||
get('/version_check', version_check_payload)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue