From f8c1822033c3a38065a90ac3221c714cdd7dd09b Mon Sep 17 00:00:00 2001 From: fatshotty Date: Wed, 1 Aug 2012 11:10:25 +0200 Subject: [PATCH] added additional options for compiling node --- nvm.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/nvm.sh b/nvm.sh index f65f31f..12051af 100755 --- a/nvm.sh +++ b/nvm.sh @@ -108,11 +108,21 @@ nvm() echo 'NVM Needs curl to proceed.' >&2; fi - if [ $# -ne 2 ]; then + if [ $# -le 2 ]; then nvm help return fi VERSION=`nvm_version $2` + ADDITIONAL_PARAMETERS='' + shift + shift + while [ $# -ne 0 ] + do + ADDITIONAL_PARAMETERS="$ADDITIONAL_PARAMETERS $1" + shift + done + + echo "Additional options while compiling: $ADDITIONAL_PARAMETERS" [ -d "$NVM_DIR/$VERSION" ] && echo "$VERSION is already installed." && return @@ -129,7 +139,7 @@ nvm() curl -C - --progress-bar $tarball -o "node-$VERSION.tar.gz" && \ tar -xzf "node-$VERSION.tar.gz" && \ cd "node-$VERSION" && \ - ./configure --prefix="$NVM_DIR/$VERSION" && \ + ./configure --prefix="$NVM_DIR/$VERSION" $ADDITIONAL_PARAMETERS && \ make && \ rm -f "$NVM_DIR/$VERSION" 2>/dev/null && \ make install