From ae5eab06ad87ea0a4e1da710c1d13813c52341b1 Mon Sep 17 00:00:00 2001 From: Dan Ungureanu Date: Fri, 25 Feb 2022 11:54:42 +0200 Subject: [PATCH] FEATURE: Add ENV to control themes:update errors (#16051) This commit introduces a new environment variable `RAISE_THEME_ERRORS` that can control what happens when `theme:update` Rake task errors. It can have three possible values: `0` to always print errors, `1` to always raise on error, or be absent to use the default behavior which raises errors only for default sites. --- lib/tasks/themes.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/themes.rake b/lib/tasks/themes.rake index 644c536e3aa..387b9d18a43 100644 --- a/lib/tasks/themes.rake +++ b/lib/tasks/themes.rake @@ -71,7 +71,7 @@ def update_themes raise RemoteTheme::ImportError.new(remote_theme.last_error_text) if remote_theme.last_error_text.present? rescue => e STDERR.puts "Failed to update '#{theme.name}': #{e}" - raise if RailsMultisite::ConnectionManagement.current_db == "default" + raise if ENV["RAISE_THEME_ERRORS"] != "0" && (ENV["RAISE_THEME_ERRORS"] == "1" || RailsMultisite::ConnectionManagement.current_db == "default") end end