From 4dcf68914cd59ce813f9cc18f055a710e10e1919 Mon Sep 17 00:00:00 2001 From: Alison Date: Thu, 15 Feb 2024 11:27:00 +0100 Subject: [PATCH] Only clean assets if they exist --- scripts/upgrade | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 57f890a..71bfeb3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -342,7 +342,9 @@ then ynh_use_nodejs corepack enable yarn install - ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails assets:clean + if [ -d "$final_path/live/public/assets" ]; then + ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails assets:clean + fi ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails assets:precompile ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails db:migrate ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/tootctl cache clear