mirror of
https://github.com/YunoHost-Apps/mattermost_ynh.git
synced 2024-09-03 19:36:29 +02:00
install: remove the custom error handler
Yunohost will automatically execute the `remove` script anyway after a failed install.
This commit is contained in:
parent
e37638f2f8
commit
f1b741980f
1 changed files with 0 additions and 21 deletions
|
@ -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
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue