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
ynh_backup_before_upgrade
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
ynh_restore_upgradebackup
}
@ -90,12 +95,11 @@ ynh_abort_if_errors
#=================================================
ynh_handle_app_migration "spip2" "spip2_migration"
if [ $migration_process -eq 1 ]
then
# If a migration has been perform
# Reload some values changed by the migration process
final_path=$(ynh_app_setting_get $app final_path)
db_name=$(ynh_app_setting_get $app db_name)
if [ $migration_process -eq 1 ]; then
# If a migration has been perform
# Reload some values changed by the migration process
final_path=$(ynh_app_setting_get $app final_path)
db_name=$(ynh_app_setting_get $app db_name)
fi
#=================================================