From 9239647b623ccb0d245bee71c45da74ef882bce8 Mon Sep 17 00:00:00 2001 From: HugoPoi Date: Sun, 4 Feb 2024 23:21:02 +0100 Subject: [PATCH] refactor: remove upgrade_type checking --- scripts/upgrade | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 19f04a3..461e834 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,12 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# CHECK VERSION -#================================================= - -upgrade_type=$(ynh_check_app_version_changed) - #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -64,13 +58,10 @@ fi # Get the current version of roundcube oldversion=$(grep RCMAIL_VERSION "$install_dir/program/include/iniset.php" | cut -d\' -f4) -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." --weight=3 +ynh_script_progression --message="Upgrading source files..." --weight=3 - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" -fi +# Download, check integrity, uncompress and patch the source from app.src +ynh_setup_source --dest_dir="$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -91,19 +82,12 @@ ynh_add_nginx_config #================================================= # CONFIGURE ROUNDCUBE #================================================= +install_roundcube_with_plugins -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - - install_roundcube_with_plugins - - # Migrate roundcube database - pushd "$install_dir" - COMPOSER_ALLOW_SUPERUSER=1 ynh_exec_warn "php$phpversion" ./bin/update.sh --version=$oldversion -y - popd -fi - - +# Migrate roundcube database +pushd "$install_dir" +COMPOSER_ALLOW_SUPERUSER=1 ynh_exec_warn "php$phpversion" ./bin/update.sh --version=$oldversion -y +popd #================================================= # END OF SCRIPT