From ed78a804460e2551fd3e65a5d97565d12ad8e5b8 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 20 Feb 2021 19:22:53 +0100 Subject: [PATCH] Update install --- scripts/install | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index 8528b16..52dee2c 100755 --- a/scripts/install +++ b/scripts/install @@ -33,9 +33,6 @@ ynh_script_progression --message="Validating installation parameters..." --weigh final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" -public_path=/home/yunohost.app/$app -test ! -e "${public_path}" || ynh_die --message="${public_path} already exists" - # Register (book) web path ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url @@ -78,9 +75,15 @@ ynh_setup_source --dest_dir=$final_path # CREATE DIRECTORIES #================================================= -ynh_app_setting_set --app=$app --key=public_path --value=$public_path -mkdir -p ${public_path}/uploads -mkdir -p ${public_path}/uploads/{big,import,medium,raw,small,thumb} +# If public_path doesn't exist, create it +if [ -z "/home/yunohost.app/$app" ]; then + public_path=/home/yunohost.app/$app + ynh_app_setting_set --app=$app --key=public_path --value=$public_path + mkdir -p ${public_path}/uploads + mkdir -p ${public_path}/uploads/{big,import,medium,raw,small,thumb} +else + ynh_die --message="This path already contains a folder" +fi # Create a dedicated NGINX config ynh_add_nginx_config "public_path"