From 7b06373fc331f2539a6beab8dbfc5f6647720067 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 6 Sep 2023 17:53:53 +0200 Subject: [PATCH] Update upgrade --- scripts/upgrade | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 28f151f..8458172 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -38,8 +38,21 @@ ynh_npm install --global yarn #================================================= ynh_script_progression --message="Setting up source files..." --weight=1 +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + ynh_script_progression --message="Upgrading source files..." + # Move old app dir + mv ${install_dir} ${install_dir}.old + # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$install_dir" --keep="config" +ynh_setup_source --dest_dir="$install_dir" + +# restore data + cp -a ${install_dir}.old/config ${install_dir} + + # delete temp directory + ynh_secure_remove --file=${install_dir}.old +fi chmod 750 "$install_dir" chmod -R o-rwx "$install_dir"