Skip to content

Commit f743ee5

Browse files
committed
chore(tests): Turn on OS X build, add build_scripts folder for complex travis commands
Squashed commits: [a46ecb2] Add needed semi-colon [e586a2e] Set environment variable differently, and set default nvm [e433682] Try adding an explicit source command. [2032d64] add some nv post-install [7a87bbf] Double check the homebrew commands. [cfd7a36] Try using an if statement again, this time with less semi-colon [2ec9c7e] try short-circuiting with the test statement [0d14509] Remove possibly unnecessary semi-colon [e003e6c] Try an if statement instead of short-circuited boolean [394baae] Add a brew install step for nvm if osx
1 parent 1e3498b commit f743ee5

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ env:
66
os:
77
- linux
88
- osx
9-
109
script: npm run-script test
1110
before_install:
11+
- source build_scripts/osx-before_install.sh
1212
- nvm install $NODE_VERSION
1313
- npm config set spin false
1414
install:

build_scripts/osx-before_install.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# no shebang as it expects to be run in the current shell, not standalone
2+
if [[ $TRAVIS_OS_NAME == "osx" ]]; then
3+
# Recommended by travis guys to always brew update first
4+
brew update
5+
# Install NVM
6+
brew install nvm
7+
# Use -p just in case the folder already exists
8+
mkdir -p ~/.nvm
9+
# Make sure the NVM_DIR is set before sourcing nvm.sh
10+
export NVM_DIR=~/.nvm && source $(brew --prefix nvm)/nvm.sh
11+
nvm alias default $NODE_VERSION
12+
fi

0 commit comments

Comments
 (0)