diff --git a/scripts/upgrade b/scripts/upgrade index 5c92518..8aa2f66 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -61,27 +61,29 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=1 - # # Create a temporary directory - # tmpdir="$(mktemp -d)" + # Create a temporary directory + tmpdir="$(mktemp -d)" - # # Backup the config file in the temp dir - # cp -a "$final_path/.env" "$tmpdir/.env" + # Backup the config file in the temp dir + cp -a "$final_path/.env" "$tmpdir/.env" + cp -a "$final_path/public/uploads" "$tmpdir/public/uploads" + cp -a "$final_path/storage/uploads" "$tmpdir/storage/uploads" # Remove the app directory securely - #ynh_secure_remove --file="$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" --keep="$final_path/.env" + ynh_setup_source --dest_dir="$final_path" - # # Copy the admin saved settings from tmp directory to final path - # cp -a "$tmpdir/.env" "$final_path/.env" + # Copy the admin saved settings from tmp directory to 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" - # # Remove the tmp directory securely - # ynh_secure_remove --file="$tmpdir" + # Remove the tmp directory securely + ynh_secure_remove --file="$tmpdir" fi - - #================================================= # NGINX CONFIGURATION #=================================================