From 729b0d66e5f5e2091c9ec2551a5161cb24222bf0 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Wed, 20 Feb 2019 09:29:26 -0800 Subject: [PATCH] Only modify the default nvm alias when running in Jenkins --- Jenkinsfile | 3 ++- scripts/test.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1e011e2a96..af8ed14976 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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) } } diff --git a/scripts/test.sh b/scripts/test.sh index 9dea7adedb..c40941da47 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -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