From 19c910fb36bfb2c941170b348ace2666b1caa524 Mon Sep 17 00:00:00 2001 From: Selamanse Date: Wed, 19 Jul 2017 17:07:36 +0200 Subject: [PATCH] Improves path check --- scripts/install | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index 76d8d4b..b1d6499 100644 --- a/scripts/install +++ b/scripts/install @@ -38,7 +38,13 @@ if [[ ! $? -eq 0 ]]; then ynh_die "domain not available" fi +final_path="/var/www/$app" +[[ -d $final_path ]] && ynh_die \ +"The destination directory '$final_path' already exists.\ + You should safely delete it before installing this app." + # Save specific settings +ynh_app_setting_set $app final_path $final_path ynh_app_setting_set $app is_public $is_public #Install dependencies @@ -58,12 +64,6 @@ sudo n $NODE_VERSION port=$(ynh_find_port 3000) # Create destination -final_path="/var/www/$app" -[[ -d $final_path ]] && ynh_die \ -"The destination directory '$final_path' already exists.\ - You should safely delete it before installing this app." - -ynh_app_setting_set $app final_path $final_path sudo mkdir -p $final_path # Copy and set systemd configuration