1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/timeoff_ynh.git synced 2024-09-03 20:35:59 +02:00
This commit is contained in:
ericgaspar 2021-11-29 22:05:09 +01:00
parent 5059829c8b
commit d10eae0f4a
No known key found for this signature in database
GPG key ID: 574F281483054D44
3 changed files with 18 additions and 6 deletions

View file

@ -32,7 +32,6 @@ app=$YNH_APP_INSTANCE_NAME
ynh_script_progression --message="Validating installation parameters..."
final_path=/var/www/$app
config_path=/home/yunohost.app/$app
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
# Register (book) web path
@ -105,6 +104,20 @@ chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#chmod -R +x "$final_path/bin"
#=================================================
# CREATE DATA DIRECTORY
#=================================================
ynh_script_progression --message="Creating a data directory..." --weight=1
datadir=/home/yunohost.app/$app
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
mkdir -p $datadir
chmod 750 "$datadir"
chmod -R o-rwx "$datadir"
chown -R $app:www-data "$datadir"
#=================================================
# NGINX CONFIGURATION
#=================================================
@ -136,7 +149,7 @@ ynh_script_progression --message="Installing TimeOff..."
pushd $final_path
ynh_use_nodejs
npm install -g npm
ynh_exec_warn_less $ynh_npm install
popd
#=================================================

View file

@ -34,8 +34,7 @@ db_user=$db_name
#=================================================
ynh_script_progression --message="Validating restoration parameters..."
test ! -d $final_path \
|| ynh_die --message="There is already a directory: $final_path "
test ! -d $final_path || ynh_die --message="There is already a directory: $final_path "
#=================================================
# STANDARD RESTORATION STEPS

View file

@ -113,8 +113,8 @@ then
ynh_script_progression --message="Upgrading the lounge..."
pushd $final_path
ynh_use_nodejs
ynh_exec_warn_less NODE_ENV=production npm cache clean
ynh_exec_warn_less NODE_ENV=production npm update
ynh_exec_warn_less $ynh_npm cache clean
ynh_exec_warn_less $ynh_npm update
popd
fi