From 959bd621723a340790215ab23f2dba0d87778b62 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 30 Nov 2021 15:53:44 +0100 Subject: [PATCH] Fix --- scripts/remove | 16 ++++++++-------- scripts/restore | 3 +-- scripts/upgrade | 17 ++++++++--------- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/scripts/remove b/scripts/remove index c503650..1d03002 100644 --- a/scripts/remove +++ b/scripts/remove @@ -30,14 +30,6 @@ ynh_script_progression --message="Removing the MySQL database..." --weight=1 # Remove a database if it exists, along with the associated user ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." --weight=1 - -# Remove metapackage and its dependencies -ynh_remove_app_dependencies - #================================================= # REMOVE THE REDIS DATABASE #================================================= @@ -69,6 +61,14 @@ ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=2 # Remove the dedicated PHP-FPM config ynh_remove_fpm_config +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." --weight=1 + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/restore b/scripts/restore index 2a271e3..fde38c3 100644 --- a/scripts/restore +++ b/scripts/restore @@ -34,8 +34,7 @@ phpversion=$YNH_PHP_VERSION #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=1 -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " +test ! -d $final_path || ynh_die --message="There is already a directory: $final_path " #================================================= # STANDARD RESTORATION STEPS diff --git a/scripts/upgrade b/scripts/upgrade index dcd35f0..ac26ebf 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -69,17 +69,16 @@ then cp -a "$final_path/storage/uploads" "$tmpdir/storage/uploads" # Remove the app directory securely + ynh_secure_remove --file=$final_path + # Download, check integrity, uncompress and patch the source from app.src + ynh_setup_source --dest_dir="$final_path" - ynh_secure_remove --file=$final_path - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" + cp -a "$tmpdir/.env " "$final_path/.env " + cp -a "$tmpdir/public/uploads" "$final_path/public/uploads" + cp -a "$tmpdir/storage/uploads" "$final_path/storage/uploads" - cp -a "$tmpdir/.env " "$final_path/.env " - cp -a "$tmpdir/public/uploads" "$final_path/public/uploads" - cp -a "$tmpdir/storage/uploads" "$final_path/storage/uploads" - - # Remove the tmp directory securely - ynh_secure_remove --file="$tmpdir" + # Remove the tmp directory securely + ynh_secure_remove --file="$tmpdir" # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" #--keep="$final_path/.env $final_path/public/uploads $final_path/storage/uploads"