diff --git a/scripts/upgrade b/scripts/upgrade index 86ba36d..413e1c5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -32,7 +32,6 @@ port=$(ynh_app_setting_get --app=$app --key=port) final_path=$(ynh_app_setting_get --app=$app --key=final_path) language=$(ynh_app_setting_get --app=$app --key=language) db_name=$(ynh_app_setting_get --app=$app --key=db_name) -architecture=$YNH_ARCH version=$(ynh_app_setting_get --app=$app --key=version) data_path=$(ynh_app_setting_get --app=$app --key=data_path) @@ -123,28 +122,11 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=2 - # Create a temporary directory - tmpdir="$(mktemp -d)" - - # Backup the config file and local plugins in the temp dir - cp -a "$final_path/config/config.json" "$tmpdir/config.json" - cp -ar "$final_path/plugins" "$tmpdir/plugins" - - # Remove the app directory securely - ynh_secure_remove --file="$final_path" - if [ "$version" = "Enterprise" ]; then - ynh_setup_source --dest_dir="$final_path" --source_id="enterprise" + ynh_setup_source --dest_dir="$final_path" --source_id="enterprise" --keep="$final_path/plugins $final_path/config/config.json" elif [ "$version" = "Team" ]; then - ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" + ynh_setup_source --dest_dir="$final_path" --source_id="$YNH_ARCH" --keep="$final_path/plugins $final_path/config/config.json" fi - - # Copy the admin saved settings and plugins from tmp directory to final path - cp -a "$tmpdir/config.json" "$final_path/config/config.json" - cp -ar --no-clobber "$tmpdir/plugins" "$final_path/" - - # Remove the tmp directory securely - ynh_secure_remove --file="$tmpdir" fi chmod 750 "$final_path"