1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/spip_ynh.git synced 2024-09-03 20:25:59 +02:00

Handle migration fail, and restore spip2

This commit is contained in:
Kayou 2019-03-14 00:24:55 +01:00
parent 9838b5913d
commit 33014beb5e
No known key found for this signature in database
GPG key ID: 823A2CBE071D3126

View file

@ -79,6 +79,11 @@ ynh_print_info "Backing up the app before upgrading (may take a while)..."
# Backup the current version of the app # Backup the current version of the app
ynh_backup_before_upgrade ynh_backup_before_upgrade
ynh_clean_setup () { ynh_clean_setup () {
if [ $migration_process -eq 1 ]; then
yunohost app remove $app
# Reload some values changed by the migration process
app=$YNH_APP_INSTANCE_NAME
fi
# restore it if the upgrade fails # restore it if the upgrade fails
ynh_restore_upgradebackup ynh_restore_upgradebackup
} }
@ -90,8 +95,7 @@ ynh_abort_if_errors
#================================================= #=================================================
ynh_handle_app_migration "spip2" "spip2_migration" ynh_handle_app_migration "spip2" "spip2_migration"
if [ $migration_process -eq 1 ] if [ $migration_process -eq 1 ]; then
then
# If a migration has been perform # If a migration has been perform
# Reload some values changed by the migration process # Reload some values changed by the migration process
final_path=$(ynh_app_setting_get $app final_path) final_path=$(ynh_app_setting_get $app final_path)