Merge pull request #370 from jpadilla/patch-1
Detect if curl or wget is installed to download NVM_SOURCEmaster
commit
192e381971
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
function fatalExit (){
|
||||
fatalExit (){
|
||||
echo "$@" && exit 1;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,16 @@ fi
|
|||
mkdir -p "$NVM_DIR"
|
||||
pushd "$NVM_DIR" > /dev/null
|
||||
echo -ne "=> Downloading... "
|
||||
curl --silent "$NVM_SOURCE" -o nvm.sh || fatalExit "Failed";
|
||||
|
||||
# Detect if curl or wget is installed to download NVM_SOURCE
|
||||
if type curl > /dev/null 2>&1; then
|
||||
curl --silent "$NVM_SOURCE" -o nvm.sh || fatalExit "Failed";
|
||||
elif type wget > /dev/null 2>&1; then
|
||||
wget --quiet "$NVM_SOURCE" -O nvm.sh || fatalExit "Failed";
|
||||
else
|
||||
fatalExit "Must have curl or wget to install nvm";
|
||||
fi
|
||||
|
||||
echo "Downloaded"
|
||||
popd > /dev/null
|
||||
|
||||
|
|
Loading…
Reference in New Issue