summaryrefslogtreecommitdiff
path: root/scripts/node/install.sh
blob: 26bf9800277de91d4e970585e95b5718ef0396a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash

set -e
set -o pipefail

mapbox_time "checkout_mason" \
git submodule update --init .mason

export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"

if [ ${TRAVIS_OS_NAME} == "linux" ]; then
    mapbox_time "install_mesa" \
    mason install mesa 10.4.3
fi

if [ ! -d ~/.nvm ]; then
    git clone https://github.com/creationix/nvm.git ~/.nvm

    pushd ~/.nvm
    git fetch
    git checkout `git describe --abbrev=0 --tags`
    popd
fi

source ~/.nvm/nvm.sh

mapbox_time $NODE_VERSION \
nvm install $NODE_VERSION

nvm alias default $NODE_VERSION

node --version
npm --version