mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
add the arch argument to ynh_install_nodejs
CF https://github.com/YunoHost/issues/issues/1311#issuecomment-466379366
This commit is contained in:
parent
bca2af3391
commit
7342f894e5
1 changed files with 8 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue