From f1b741980f58e93fdc1514eb154a284f6f5df041 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Tue, 10 Oct 2017 17:31:48 +0530 Subject: [PATCH] install: remove the custom error handler Yunohost will automatically execute the `remove` script anyway after a failed install. --- scripts/install | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/scripts/install b/scripts/install index b213ab3..0c1a6d0 100644 --- a/scripts/install +++ b/scripts/install @@ -64,27 +64,6 @@ ynh_webpath_register $app $domain $path_url # Store setting ynh_app_setting_set "$app" domain "$domain" -#================================================= -# REGISTER ERROR HANDLER -#================================================= - -# Delete db and user if exit with an error -# (N.B. this section doesn't seem executed on Yunohost >= 2.7 ; the `remove` script is executed instead.) -function fail_properly -{ - set +e - # Remove database - # (DROP USER IF EXISTS is only available on MySQL >= 5.7, so we don't use it for now) - ynh_mysql_execute_as_root "DROP DATABASE IF EXISTS $db_name ; DROP USER $db_user@localhost ;" - - sudo userdel mattermost - sudo rm -Rf "$final_path" - sudo rm -f "$archive_filename" - - script_die "An error occurred during the installation." -} -trap fail_properly ERR - #================================================= # SET UP INSTALLATION VARIABLES #=================================================