Skip to content

Commit

Permalink
fix install_node [publish binary]
Browse files Browse the repository at this point in the history
  • Loading branch information
Dane Springmeyer committed Mar 29, 2016
1 parent 84b4aec commit c86f8bd
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions scripts/install_node.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
#!/usr/bin/env bash

if [[ ${1:-false} == 'false' ]]; then
echo "Error: pass node version as first argument"
exit 1
fi

NODE_VERSION=$1

# if an existing nvm is already installed we need to unload it
nvm unload || true

# here we set up the node version on the fly based on the matrix value.
# This is done manually so that the build works the same on OS X
rm -rf ~/.nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ~/.nvm
source ~/.nvm/nvm.sh
nvm install $1
nvm use $1
rm -rf ./__nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ./__nvm
source ./__nvm/nvm.sh
nvm install ${NODE_VERSION}
nvm use ${NODE_VERSION}
node --version
npm --version
which node
which node

0 comments on commit c86f8bd

Please sign in to comment.