From 2957d67133a45948d809454a359b862d5765695f Mon Sep 17 00:00:00 2001 From: Tobias Ollive Date: Mon, 12 Apr 2021 17:16:50 +0200 Subject: [PATCH] use specific $home value to avoid right error --- scripts/install | 6 ++++++ scripts/restore | 7 +++++-- scripts/upgrade | 7 +++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index e35f279..dab2552 100644 --- a/scripts/install +++ b/scripts/install @@ -99,17 +99,23 @@ ynh_system_user_create --username=$app --home_dir=$final_path ynh_script_progression --message="Installing application using node..." pushd $final_path +# use custom home value to avoid bower storing values in root and have right errors + TMP_HOME=$HOME + HOME=$(pwd) ynh_use_nodejs ynh_npm install + HOME=$TMP_HOME popd #================================================= # SECURE FILES AND DIRECTORIES #================================================= + chown -R $app:$app $final_path chmod -R o-rwx $final_path + #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= diff --git a/scripts/restore b/scripts/restore index b1f27d9..62ef7d2 100644 --- a/scripts/restore +++ b/scripts/restore @@ -68,8 +68,11 @@ ynh_script_progression --message="Reinstalling the app ..." --weight=5 ynh_setup_source --dest_dir="$final_path" pushd $final_path - ynh_use_nodejs - ynh_npm install + TMP_HOME=$HOME + HOME=$(pwd) + ynh_use_nodejs + ynh_npm install + HOME=$TMP_HOME popd diff --git a/scripts/upgrade b/scripts/upgrade index f938711..9556209 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -84,8 +84,11 @@ ynh_install_nodejs --nodejs_version=$NODEJS_VERSION ynh_script_progression --message="Upgrading the app..." --weight=5 pushd $final_path - ynh_use_nodejs - ynh_npm install + TMP_HOME=$HOME + HOME=$(pwd) + ynh_use_nodejs + ynh_npm install + HOME=$TMP_HOME popd #=================================================