From 99128199704ecfec90e36e0a2ed352d602ef3235 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Tue, 10 Apr 2018 00:22:39 +0200 Subject: [PATCH] Fix n usage in upgrade and remove --- scripts/_common.sh | 6 +++--- scripts/upgrade | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 147560b..c47f657 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -59,7 +59,7 @@ SOURCE_SUM=2ba3c9d4dd3c7e38885b37e02337906a1ee91febe6d5c9159d89a9050f2eea8f" > " # And 2 alias stored in variables: # - $nodejs_use_version: An old variable, not used anymore. Keep here to not break old apps # NB: $PATH will contain the path to node, it has to be propagated to any other shell which needs to use it. -# That's means it have to be added to any systemd script. +# That's means it has to be added to any systemd script. # # usage: ynh_use_nodejs ynh_use_nodejs () { @@ -150,7 +150,7 @@ ynh_install_nodejs () { # # usage: ynh_remove_nodejs ynh_remove_nodejs () { - ynh_use_nodejs + nodejs_version=$(ynh_app_setting_get $app nodejs_version) # Remove the line for this app sed --in-place "/$YNH_APP_ID:$nodejs_version/d" "$n_install_dir/ynh_app_version" @@ -158,7 +158,7 @@ ynh_remove_nodejs () { # If no other app uses this version of nodejs, remove it. if ! grep --quiet "$nodejs_version" "$n_install_dir/ynh_app_version" then - n rm $nodejs_version + $n_install_dir/bin/n rm $nodejs_version fi # If no other app uses n, remove n diff --git a/scripts/upgrade b/scripts/upgrade index d1bba78..29ce234 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -232,7 +232,6 @@ ynh_use_logrotate --non-append # SETUP SYSTEMD #================================================= -ynh_replace_string "__NODEJS__" "$nodejs_use_version" "../conf/systemd.service" ynh_replace_string "__ENV_PATH__" "$PATH" "../conf/systemd.service" ynh_add_systemd_config