From a554f8c5a6894fc1a894a22d80a039910a276617 Mon Sep 17 00:00:00 2001 From: Yalh Date: Tue, 29 Jan 2019 03:27:53 +0100 Subject: [PATCH] Fix restore and upgrade --- scripts/install | 4 ++-- scripts/remove | 4 ++-- scripts/restore | 6 ++---- scripts/upgrade | 14 +++++++++++--- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/scripts/install b/scripts/install index 6a024c2..fbd5efc 100644 --- a/scripts/install +++ b/scripts/install @@ -98,6 +98,8 @@ ynh_app_setting_set $app port $port #ynh_install_app_dependencies deb1 deb2 +ynh_install_nodejs 8 + #================================================= # CREATE A MYSQL DATABASE #================================================= @@ -168,8 +170,6 @@ ynh_system_user_create $app # ... #================================================= -ynh_install_nodejs 8 - chown -R $app:$app $final_path mkdir -p /var/log/$app diff --git a/scripts/remove b/scripts/remove index 2f8603f..97cdffa 100644 --- a/scripts/remove +++ b/scripts/remove @@ -48,6 +48,8 @@ ynh_remove_systemd_config # Remove metapackage and its dependencies #ynh_remove_app_dependencies +ynh_remove_nodejs + #================================================= # REMOVE THE MYSQL DATABASE #================================================= @@ -99,8 +101,6 @@ fi # REMOVE THE CRON FILE #================================================= -ynh_remove_nodejs - #npm uninstall -g ts-node #npm uninstall -g typescript diff --git a/scripts/restore b/scripts/restore index 204d8a7..c986768 100644 --- a/scripts/restore +++ b/scripts/restore @@ -94,10 +94,7 @@ chown -R $app:$app /var/log/$app # Define and install dependencies #ynh_install_app_dependencies deb1 deb2 -ynh_install_nodejs 11 -ynh_use_nodejs -npm install -g typescript -npm install -g ts-node +ynh_install_nodejs 8 #================================================= # RESTORE SYSTEMD @@ -133,3 +130,4 @@ ynh_restore_file "/etc/logrotate.d/$app" #systemctl reload php5-fpm systemctl reload nginx +sleep 10 diff --git a/scripts/upgrade b/scripts/upgrade index 1c6b832..764012e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -92,6 +92,8 @@ ynh_add_nginx_config #ynh_install_app_dependencies deb1 deb2 +ynh_install_nodejs 8 + #================================================= # CREATE DEDICATED USER #================================================= @@ -112,10 +114,15 @@ ynh_system_user_create $app # ... #================================================= -ynh_install_nodejs 11 +pushd $final_path ynh_use_nodejs -npm install -g typescript -npm install -g ts-node +npm install hoek@^4.2.1 --save +npm install +npm audit fix +npm install typescript@>=2.0 --save +npm install ts-node +popd + ### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script. ### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it. @@ -167,3 +174,4 @@ fi #================================================= systemctl reload nginx +sleep 10