From d4223661b150bfdad2b406603a724d0679b1d81f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 14 Jun 2024 22:06:58 +0200 Subject: [PATCH] Update upgrade --- scripts/upgrade | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index daf71a6..cb51fce 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,28 +9,18 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# CHECK VERSION -#================================================= - -upgrade_type=$(ynh_check_app_version_changed) - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression --message="Upgrading source files..." --weight=24 -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." --weight=24 +# Download, check integrity, uncompress and patch the source from app.src +ynh_setup_source --dest_dir="$install_dir" --full_replace=1 - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --full_replace=1 - - # Add "offline" parameter in index.html - # See https://desk.draw.io/support/solutions/articles/16000042546-what-url-parameters-are-supported- - sed_pattern="s/var params = window.location.search.slice(1).split('&');/&\n\t\t\tparams.push(\"offline=1\");/g" - sed -i "$sed_pattern" "$install_dir/src/main/webapp/index.html" -fi +# Add "offline" parameter in index.html +# See https://desk.draw.io/support/solutions/articles/16000042546-what-url-parameters-are-supported- +sed_pattern="s/var params = window.location.search.slice(1).split('&');/&\n\t\t\tparams.push(\"offline=1\");/g" +sed -i "$sed_pattern" "$install_dir/src/main/webapp/index.html" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir"