From bb0718550a6e8f30adf23a0e7a6e396126d2a61d Mon Sep 17 00:00:00 2001 From: shine <4771718+shinenelson@users.noreply.github.com> Date: Wed, 2 Oct 2019 22:58:52 +0530 Subject: [PATCH] fix incorrect yunohost function calls (#36) * [scripts][upgrade] fix nginx config yunohost helper function call * [scripts][upgrade] fix backup after failed upgrade yunohost helper function call * [scripts] fix deprecated variable use - nodejs_version * [scripts][upgrade] fix systemd config yunohost helper function call --- scripts/install | 2 +- scripts/upgrade | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index 1350852..df77f99 100644 --- a/scripts/install +++ b/scripts/install @@ -103,7 +103,7 @@ ynh_add_nginx_config # Create a dedicated systemd config ynh_add_systemd_config -ynh_replace_string "__NODEJS__" "$nodejs_use_version" "/etc/systemd/system/$app.service" +ynh_replace_string "__NODEJS__" "$nodejs_version" "/etc/systemd/system/$app.service" ynh_replace_string "__ENV_PATH__" "$PATH" "/etc/systemd/system/$app.service" ynh_replace_string "__NODE__" "$nodejs_path" "/etc/systemd/system/$app.service" systemctl daemon-reload diff --git a/scripts/upgrade b/scripts/upgrade index 7d79c80..20a1c90 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -39,7 +39,7 @@ port=$(ynh_app_setting_get "$app" port) if [ -f "/etc/yunohost/apps/$app/scripts/backup" ] ; then ynh_backup_before_upgrade # Backup the current version of the app ynh_clean_setup () { - ynh_backup_after_failed_upgrade + ynh_restore_upgradebackup } ynh_abort_if_errors # Stop script if an error is detected fi @@ -80,16 +80,16 @@ sudo chmod 755 $final_path -R # Modify Nginx configuration file and copy it to Nginx conf directory #================================================= -ynh_nginx_config +ynh_add_nginx_config #================================================= # ADD SYSTEMD SERVICE #================================================= ynh_replace_string "__NODE__" "$nodejs_path" "../conf/systemd.service" -ynh_replace_string "__NODEJS__" "$nodejs_use_version" "../conf/systemd.service" +ynh_replace_string "__NODEJS__" "$nodejs_version" "../conf/systemd.service" ynh_replace_string "__ENV_PATH__" "$PATH" "../conf/systemd.service" -ynh_systemd_config +ynh_add_systemd_config #=================================================