Skip to content

Commit c86f8bd

Browse files
author
Dane Springmeyer
committed
fix install_node [publish binary]
1 parent 84b4aec commit c86f8bd

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

scripts/install_node.sh

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
1+
#!/usr/bin/env bash
2+
3+
if [[ ${1:-false} == 'false' ]]; then
4+
echo "Error: pass node version as first argument"
5+
exit 1
6+
fi
7+
8+
NODE_VERSION=$1
9+
10+
# if an existing nvm is already installed we need to unload it
11+
nvm unload || true
12+
113
# here we set up the node version on the fly based on the matrix value.
214
# This is done manually so that the build works the same on OS X
3-
rm -rf ~/.nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ~/.nvm
4-
source ~/.nvm/nvm.sh
5-
nvm install $1
6-
nvm use $1
15+
rm -rf ./__nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ./__nvm
16+
source ./__nvm/nvm.sh
17+
nvm install ${NODE_VERSION}
18+
nvm use ${NODE_VERSION}
719
node --version
820
npm --version
9-
which node
21+
which node

0 commit comments

Comments
 (0)