mirror of
https://github.com/YunoHost-Apps/svgedit_ynh.git
synced 2024-09-03 20:26:24 +02:00
55 lines
1.4 KiB
Bash
Executable file
55 lines
1.4 KiB
Bash
Executable file
#!/bin/bash
|
||
|
||
# Source YunoHost helpers
|
||
source /usr/share/yunohost/helpers
|
||
source _common.sh
|
||
|
||
# Exit if an error occurs during the execution of the script
|
||
ynh_abort_if_errors
|
||
|
||
export app=$YNH_APP_INSTANCE_NAME
|
||
|
||
# Retrieve arguments
|
||
ynh_export domain path_url is_public
|
||
export final_path=/var/www/$app
|
||
|
||
# Check if the app can be installed with this args
|
||
ynh_final_path_available
|
||
|
||
# Normalize the url path syntax
|
||
path_url=$(ynh_normalize_url_path $path_url)
|
||
|
||
# Check web path availability
|
||
ynh_webpath_available $domain $path_url
|
||
# Register (book) web path
|
||
ynh_webpath_register $app $domain $path_url
|
||
|
||
# Save app settings
|
||
ynh_save_args is_public final_path path_url
|
||
|
||
# Check needed packages
|
||
ynh_install_app_dependencies $pkg_dependencies
|
||
|
||
# Copy source files
|
||
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 "/"
|
||
|
||
# Modify Nginx configuration file and copy it to Nginx conf directory
|
||
ynh_add_nginx_config
|
||
|
||
# Send a readme to the admin
|
||
ynh_print_OFF
|
||
message="You can now draw this address: https://${domain}${path_url}/
|
||
If you facing an issue or want to improve this app, please open a new issue in this project: https://github.com/YunoHost-Apps/svgedit_ynh"
|
||
|
||
ynh_send_readme_to_admin "$message"
|
||
ynh_print_ON
|