Skip to content

Commit 7bcd1c3

Browse files
committed
Automatically use latest nvm
1 parent 23906d3 commit 7bcd1c3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

install.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#!/bin/bash
22
set -e
3-
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
43
export NVM_DIR="$HOME/.nvm"
54
export NVM_NODEJS_ORG_MIRROR="$2"
5+
git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR"
6+
pushd "$NVM_DIR"
7+
git checkout `git describe --abbrev=0 --tags --match "v[0-9]*" $(git rev-list --tags --max-count=1)`
8+
popd
69
chmod +x "$NVM_DIR/nvm.sh"
710
. "$NVM_DIR/nvm.sh" --no-use
8-
nvm install $1
9-
nvm use $1
10-
npm -g install npm@latest
11+
nvm install "$1"
1112
echo "SETUP_NODE_NVM_NODE: $(which node)"
1213
echo "SETUP_NODE_NVM_NPM: $(which npm)"

0 commit comments

Comments
 (0)