mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
FEATURE: display commit hash for each plugin on /admin/plugins
page. (#22176)
It will help to find out the current version of the plugins even without the `docker_manager` plugin.
This commit is contained in:
@ -516,6 +516,19 @@ class Plugin::Instance
|
||||
initializers << block
|
||||
end
|
||||
|
||||
def commit_hash
|
||||
git_repo.latest_local_commit
|
||||
end
|
||||
|
||||
def commit_url
|
||||
return if commit_hash.blank?
|
||||
"#{git_repo.url}/commit/#{commit_hash}"
|
||||
end
|
||||
|
||||
def git_repo
|
||||
@git_repo ||= GitRepo.new(directory, name)
|
||||
end
|
||||
|
||||
def before_auth(&block)
|
||||
if @before_auth_complete
|
||||
raise "Auth providers must be registered before omniauth middleware. after_initialize is too late!"
|
||||
|
Reference in New Issue
Block a user