From cbc9f6eabfe28aeba001bb7adb4fc491ba20cbed Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 26 Jun 2019 02:18:54 +0200 Subject: [PATCH 1/2] Fix public/system restoration --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 3dafd21..524a7fc 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -169,8 +169,8 @@ then # Download Mastodon mv "$final_path/live" "$final_path/live_back" ynh_setup_source --dest_dir="$final_path/live" - if [ -z $final_path/live_back/public/system ]; then - rsync -a "$final_path/live_back/public/system" "$final_path/live_back/public/." + if [ -d "$final_path/live_back/public/system" ]; then + rsync -a "$final_path/live_back/public/system" "$final_path/live/public/." fi rsync -a "$final_path/live_back/.env.production" "$final_path/live/." rm -Rf "$final_path/live_back" From 86543fc1f0e6b87cff1a39c9c24f2643ab8c702d Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 26 Jun 2019 07:00:51 +0200 Subject: [PATCH 2/2] remove rm -rf --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 524a7fc..46e7229 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -173,7 +173,7 @@ then rsync -a "$final_path/live_back/public/system" "$final_path/live/public/." fi rsync -a "$final_path/live_back/.env.production" "$final_path/live/." - rm -Rf "$final_path/live_back" + ynh_secure_remove --file="$final_path/live_back/" # Clean files which are not needed anymore ynh_secure_remove --file="$final_path/live/config/initializers/timeout.rb"