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 #=================================================