FIX: Save updated remote theme, only update enabled themes/components (#11960)

This commit is contained in:
Penar Musaraj 2021-02-03 22:44:07 -05:00 committed by GitHub
parent 97b55af9cf
commit 3da2e85855
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,11 +53,12 @@ end
desc "Update themes & theme components"
task "themes:update" => :environment do |task, args|
Theme.where(auto_update: true).find_each do |theme|
Theme.where(auto_update: true, enabled: true).find_each do |theme|
begin
if theme.remote_theme.present?
puts "Updating #{theme.name}..."
theme.remote_theme.update_from_remote
theme.save!
end
rescue => e
STDERR.puts "Failed to update #{theme.name}"