From a2b44d0d1daa6b2ec7fd5d9f41b1e47f8afda20c Mon Sep 17 00:00:00 2001 From: rocky-III Date: Wed, 19 Oct 2022 02:31:55 +0200 Subject: [PATCH] Update upgrade --- scripts/upgrade | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 49a41324..b28caae5 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -100,10 +100,23 @@ ynh_system_user_create --username=$app --home_dir="$final_path" if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=1 + + tmpdir="$(mktemp -d)" + cp "$final_path/.htconfig.php" "$tmpdir/.htconfig.php" + cp "$final_path/php.log" "$tmpdir/php.log" + rsync -a "$final_path/store" "$tmpdir/." + ynh_secure_remove --file="$final_path" # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" --keep="store/ .htconfig.php php.log" ynh_setup_source --dest_dir="$final_path/addon" --source_id="app_addons" + + cp "$tmpdir/.htconfig.php" "$final_path/.htconfig.php" + cp "$tmpdir/php.log" "$final_path/php.log" + rsync -a "$tmpdir/store" "$final_path/." + ynh_secure_remove --file="$tmpdir" +fi + fi mkdir -p "$final_path/store"