From 81178e0841d81cf07da56826bda4c16403269a1c Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 22 Feb 2019 17:55:42 +0100 Subject: [PATCH] remove arguments and let ynh_install_nodejs manage the issue --- data/helpers.d/nodejs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/data/helpers.d/nodejs b/data/helpers.d/nodejs index f48685ece..f277eeef0 100644 --- a/data/helpers.d/nodejs +++ b/data/helpers.d/nodejs @@ -64,12 +64,10 @@ ynh_install_nodejs () { # Declare an array to define the options of this helper. local legacy_args=n - declare -Ar args_array=( [n]=nodejs_version= [a]=arch=) + declare -Ar args_array=( [n]=nodejs_version= ) local nodejs_version - local arch # Manage arguments with getopts ynh_handle_getopts_args "$@" - arch=${arch:-} # Create $n_install_dir mkdir -p "$n_install_dir" @@ -100,11 +98,11 @@ ynh_install_nodejs () { test -x /usr/bin/npm_n && mv /usr/bin/npm_n /usr/bin/npm # Install the requested version of nodejs - if [ -z "$arch" ] + if [[ $uname =~ aarch64 || $uname =~ arm64]] then - n $nodejs_version + n $nodejs_version --arch=arm64 else - n $nodejs_version --arch=$arch + n $nodejs_version fi # Find the last "real" version for this major version of node.