node-fontnik/scripts/install_node.sh
Mike Morris fd264dc0d6 Publish Node.js v6.x LTS binaries (#115)
* update build-glyphs help and building from source instructions

* test and build binaries for Node.js v6.x LTS instead of v5.x

* make sure we're using correct NODE_VERSION in install.md
2016-10-21 18:34:50 -04:00

24 lines
562 B
Bash
Executable File

#!/usr/bin/env bash
set -e
set -o pipefail
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
set +e
set +u
source ./__nvm/nvm.sh
nvm install ${NODE_VERSION}
nvm use ${NODE_VERSION}