From 7342f894e5e2087e97ba0a9c2595ccb103e6e6ce Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 22 Feb 2019 14:28:08 +0100 Subject: [PATCH] add the arch argument to ynh_install_nodejs CF https://github.com/YunoHost/issues/issues/1311#issuecomment-466379366 --- data/helpers.d/nodejs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/data/helpers.d/nodejs b/data/helpers.d/nodejs index c4332b60c..9b16f5729 100644 --- a/data/helpers.d/nodejs +++ b/data/helpers.d/nodejs @@ -64,8 +64,9 @@ ynh_install_nodejs () { # Declare an array to define the options of this helper. local legacy_args=n - declare -Ar args_array=( [n]=nodejs_version= ) + declare -Ar args_array=( [n]=nodejs_version= [a]=arch=) local nodejs_version + local arch # Manage arguments with getopts ynh_handle_getopts_args "$@" @@ -98,7 +99,12 @@ ynh_install_nodejs () { test -x /usr/bin/npm_n && mv /usr/bin/npm_n /usr/bin/npm # Install the requested version of nodejs - n $nodejs_version + if [ -z "$arch" ] + then + n $nodejs_version + else + n $nodejs_version --arch=$arch + fi # Find the last "real" version for this major version of node. real_nodejs_version=$(find $node_version_path/$nodejs_version* -maxdepth 0 | sort --version-sort | tail --lines=1)