mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 01:31:35 +08:00
FEATURE: Add auto update field to themes (#11102)
Themes marked for auto update will be automatically updated when Discourse is updated. This is triggered by discourse_docker or docker_manager running Rake task 'themes:update'.
This commit is contained in:
@ -51,6 +51,22 @@ task "themes:install" => :environment do |task, args|
|
||||
end
|
||||
end
|
||||
|
||||
desc "Update themes & theme components"
|
||||
task "themes:update" => :environment do |task, args|
|
||||
Theme.where(auto_update: true).find_each do |theme|
|
||||
begin
|
||||
if theme.remote_theme.present?
|
||||
puts "Updating #{theme.name}..."
|
||||
theme.remote_theme.update_from_remote
|
||||
end
|
||||
rescue => e
|
||||
STDERR.puts "Failed to update #{theme.name}"
|
||||
STDERR.puts e
|
||||
STDERR.puts e.backtrace
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
desc "List all the installed themes on the site"
|
||||
task "themes:audit" => :environment do
|
||||
components = Set.new
|
||||
|
Reference in New Issue
Block a user