diff --git a/scripts/restore b/scripts/restore index 15dd8a7..df3890b 100755 --- a/scripts/restore +++ b/scripts/restore @@ -24,7 +24,7 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version #================================================= ynh_script_progression --message="Restoring the app main directory..." --weight=1 -ynh_restore_file --origin_path="$install_dir" +ynh_restore_file --origin_path="$install_dir" --full_replace=1 chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" diff --git a/scripts/upgrade b/scripts/upgrade index 5fc6963..1c0a6d5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,7 +22,7 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from manifest.toml -ynh_setup_source --dest_dir="$install_dir" +ynh_setup_source --dest_dir="$install_dir" --full_replace=1 chown -R "$app:www-data" "$install_dir" @@ -39,11 +39,10 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Configuring the app..." --weight=10 -pushd $install_dir - ynh_use_nodejs - ynh_exec_warn_less $ynh_npm install -g npm@latest serve - ynh_exec_warn_less $ynh_npm install - ynh_exec_warn_less $ynh_npm run build +pushd "$install_dir" + ynh_use_nodejs + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm install + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm run build popd chmod -R o-rwx "$install_dir"