From 5881149ff05d11a89f0a058b0ad7f2194e0f4d60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sat, 27 Jan 2024 16:33:10 +0100 Subject: [PATCH] Fix upgrade after rework --- scripts/upgrade | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 96ee852..90681fb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,6 +9,16 @@ source _common.sh source /usr/share/yunohost/helpers +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 + +# Cleanup previous package that ynh_setup_source on install_dir +if [ ! -d "$install_dir/www" ]; then + ynh_secure_remove "$install_dir"/* "$install_dir"/.* +fi + #================================================= # INSTALL DEPENDENCIES #================================================= @@ -49,12 +59,12 @@ ynh_secure_remove "$install_dir/source" #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -ynh_add_config --template="config.example.js" --destination="$install_dir/www/public/config/config.js" +ynh_add_config --template="config.example.js" --destination="$install_dir/www/config/config.js" chmod -R o-rwx "$install_dir" chown -R "$app:www-data" "$install_dir" -chmod 400 "$install_dir/www/public/config/config.js" +chmod 400 "$install_dir/www/config/config.js" #================================================= # NGINX CONFIGURATION