Skip to content

Commit

Permalink
Only modify the default nvm alias when running in Jenkins
Browse files Browse the repository at this point in the history
  • Loading branch information
tgoyne committed Feb 20, 2019
1 parent 0d25db5 commit 729b0d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Jenkinsfile
Expand Up @@ -229,7 +229,8 @@ def doDockerBuild(target, postStep = null) {
def doMacBuild(target, postStep = null) {
return {
node('osx_vegas') {
withEnv(['DEVELOPER_DIR=/Applications/Xcode-9.4.app/Contents/Developer']) {
withEnv(['DEVELOPER_DIR=/Applications/Xcode-9.4.app/Contents/Developer',
'REALM_SET_NVM_ALIAS=1']) {
doInside("./scripts/test.sh", target, postStep)
}
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/test.sh
Expand Up @@ -231,7 +231,7 @@ if [[ "$(command -v nvm)" ]]; then
nvm install $NODE_VERSION
fi
set_nvm_default() {
if [[ "$(command -v nvm)" ]]; then
if [ -n "$REALM_SET_NVM_ALIAS" ] && [[ "$(command -v nvm)" ]]; then
nvm_old_default="$(nvm alias default --no-colors | cut -d ' ' -f 3)"
nvm alias default $(nvm current)
fi
Expand Down

0 comments on commit 729b0d6

Please sign in to comment.