From d10eae0f4ae5f5ba73f9cb1feb960d1ebaaf15a9 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 29 Nov 2021 22:05:09 +0100 Subject: [PATCH] Fix --- scripts/install | 17 +++++++++++++++-- scripts/restore | 3 +-- scripts/upgrade | 4 ++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index 4854367..4214831 100644 --- a/scripts/install +++ b/scripts/install @@ -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 #================================================= diff --git a/scripts/restore b/scripts/restore index 936e5b0..d137a15 100644 --- a/scripts/restore +++ b/scripts/restore @@ -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 diff --git a/scripts/upgrade b/scripts/upgrade index 95b4f54..668fc5c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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