From 69206d2626f72d6b5977d72229a52db42b4c2640 Mon Sep 17 00:00:00 2001 From: Simon Mellerin Date: Wed, 30 Dec 2020 20:31:36 +0100 Subject: [PATCH] Upgrade script - test with temp dir --- scripts/upgrade | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index f3a01f5..3c74d8f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -85,8 +85,16 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." + # Create tmpdir for new sources + tmpdir="$(ynh_smart_mktemp min_size=300)" + # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" + ynh_setup_source --dest_dir="$tmpdir" + + # Replace the old aeneria by the new one + ynh_secure_remove --file="$final_path" + mv "$tmpdir" "$final_path" + ynh_secure_remove --file="$tmpdir" fi #=================================================