From 8015788d27b0217a5494399fefa3e52e2a09d2c2 Mon Sep 17 00:00:00 2001 From: Espen Volden Date: Thu, 9 Aug 2012 11:18:52 +0200 Subject: [PATCH] Added support for FreeBSD --- nvm.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nvm.sh b/nvm.sh index ad4e4d5985..2c65ce1c2b 100755 --- a/nvm.sh +++ b/nvm.sh @@ -14,6 +14,10 @@ fi # This fixes the "zsh: no matches found" errors unsetopt nomatch 2>/dev/null +# Use gmake when available to support FreeBSD +MAKE_BIN='make' +command -v gmake >/dev/null 2>&1 && MAKE_BIN='gmake' + # Expand a version using the version cache nvm_version() { @@ -140,9 +144,9 @@ nvm() tar -xzf "node-$VERSION.tar.gz" && \ cd "node-$VERSION" && \ ./configure --prefix="$NVM_DIR/$VERSION" $ADDITIONAL_PARAMETERS && \ - make && \ + $MAKE_BIN && \ rm -f "$NVM_DIR/$VERSION" 2>/dev/null && \ - make install + $MAKE_BIN install ) then nvm use $VERSION