1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ethercalc_ynh.git synced 2024-09-03 18:26:36 +02:00

Code refactoring

This commit is contained in:
Rafi59 2017-06-27 13:44:49 +02:00 committed by GitHub
parent a9ba9dced9
commit 87fd0f6ad1

View file

@ -21,10 +21,10 @@ ynh_abort_if_errors
#=================================================
domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH
admin=$YNH_APP_ARG_ADMIN
is_public=$YNH_APP_ARG_IS_PUBLIC
language=$YNH_APP_ARG_LANGUAGE
path_url="" # Assure la compatibilité avec les fonctions utilisant $path_url
# This is a multi-instance app, meaning it can be installed several times independently
# The id of the app as stated in the manifest is available as $YNH_APP_ID
@ -58,7 +58,6 @@ test ! -e "$final_path" || ynh_die "This path already contains a folder"
#=================================================
ynh_app_setting_set $app domain $domain
ynh_app_setting_set $app path $path_url
ynh_app_setting_set $app admin $admin
ynh_app_setting_set $app is_public $is_public
ynh_app_setting_set $app language $language
@ -129,7 +128,7 @@ ynh_fpm_config
#=================================================
# SPECIFIC SETUP
#=================================================
# ...
#=================================================
#=================================================
@ -140,22 +139,13 @@ ynh_fpm_config
ynh_systemd_config
#=================================================
# SETUP APPLICATION WITH CURL
# INSTALL ETHERCALC
#=================================================
# Set right permissions for curl install
sudo chown -R $app: $final_path
# Set the app as temporarily public for curl call
ynh_app_setting_set $app unprotected_uris "/"
# Reload SSOwat config
sudo yunohost app ssowatconf
# Reload Nginx
sudo systemctl reload nginx
# Installation with curl
ynh_local_curl "/INSTALL_PATH" "key1=value1" "key2=value2" "key3=value3"
# Installe les dépendances de ethercalc et procède à l'intallation.
ynh_use_nodejs
sudo_path "$final_path/bin/installDeps.sh" > $install_log 2>&1
sudo_path npm install forever -g >> $install_log 2>&1
#=================================================
# STORE THE CHECKSUM OF THE CONFIG FILE