Skip to content

Commit 190de8f

Browse files
committed
Break out build osx before_install into script
1 parent a46ecb2 commit 190de8f

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
@@ -8,7 +8,7 @@ os:
88
- osx
99
script: npm run-script test
1010
before_install:
11-
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then echo "updating nvm for osx"; brew update; brew install nvm; mkdir ~/.nvm; export NVM_DIR=~/.nvm && source $(brew --prefix nvm)/nvm.sh; nvm alias default $NODE_VERSION; fi
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)