1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/svgedit_ynh.git synced 2024-09-03 20:26:24 +02:00
svgedit_ynh/scripts/upgrade
2019-02-18 22:49:00 +01:00

54 lines
1.2 KiB
Bash
Executable file

#!/bin/bash
# Source YunoHost helpers
source /usr/share/yunohost/helpers
source _common.sh
# See comments in install script
export app=$YNH_APP_INSTANCE_NAME
# Retrieve app settings
ynh_get_and_export domain path_url is_public final_path
# Check version
ynh_abort_if_up_to_date
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
# Normalize the url path syntax
path_url=$(ynh_normalize_url_path $path_url)
# Step migration
version=${version:-2.8.1}
if ynh_version_le "2.8.1" ; then
final_path=${final_path:-/var/www/$app}
ynh_app_setting_set "$app" final_path "$final_path"
# Install dependency properly
ynh_install_app_dependencies $pkg_dependencies
fi
# Copy source files
ynh_secure_remove $final_path
ynh_setup_source "$final_path"
# Custom instructions
ynh_configure config.js "$final_path/config.js"
ynh_configure custom.css "$final_path/custom.css"
# Set permissions to app files
ynh_set_default_perm "$final_path"
# If app is public, add url to SSOWat conf as skipped_uris
ynh_sso_access "/"
# Set up nginx configuration
ynh_add_nginx_config