Skip to content

Commit deb1aaa

Browse files
committed
WIP
1 parent 6b219c5 commit deb1aaa

File tree

2 files changed

+10
-28
lines changed

2 files changed

+10
-28
lines changed

.evergreen/install-node.sh

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,6 @@ if [ "$OS" == "Windows_NT" ]; then
1212

1313
curl -sSfLO https://raw.githubusercontent.com/mongodb-js/compass/42e6142ae08be6fec944b80ff6289e6bcd11badf/.evergreen/node-gyp-bug-workaround.sh && bash node-gyp-bug-workaround.sh
1414
else
15-
if which realpath; then # No realpath on macOS, but also not needed there
16-
export HOME="$(realpath "$HOME")" # Needed to de-confuse nvm when /home is a symlink
17-
fi
18-
# Some Node.js driver versions leave a ~/.npmrc file lying around
19-
# that breaks nvm because it contains a 'prefix=' option (pointing
20-
# to a directory that no longer exists anyway).
21-
if [ -e "$HOME/.npmrc" ]; then
22-
# different `sed` arguments on macOS than for GNU sed ...
23-
if [ `uname` == Darwin ]; then
24-
sed -i'~' -e 's/^prefix=.*$//' "$HOME/.npmrc"
25-
else
26-
sed -i "$HOME/.npmrc" -e 's/^prefix=.*$//'
27-
fi
28-
fi
29-
3015
npm cache clear --force || true # Try to work around `Cannot read property 'pickAlgorithm' of null` errors in CI
3116
fi
3217

.evergreen/setup-env.sh

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -x
44
OS_ARCH="$(uname "-m")"
55

66
export BASEDIR="$PWD/.evergreen"
7-
export PATH="/opt/devtools/node20/bin:/opt/devtools/bin:/cygdrive/c/python/Python311/Scripts:/cygdrive/c/python/Python311:/cygdrive/c/Python311/Scripts:/cygdrive/c/Python311:/opt/python/3.6/bin:$BASEDIR/mingit/cmd:$BASEDIR/mingit/mingw64/libexec/git-core:$BASEDIR/git-2:$BASEDIR/npm-10/node_modules/.bin:$BASEDIR/node-v$NODE_JS_VERSION-win-x64:/opt/java/jdk16/bin:/opt/chefdk/gitbin:/cygdrive/c/cmake/bin:$PATH"
7+
export PATH="/opt/devtools/bin:/cygdrive/c/python/Python311/Scripts:/cygdrive/c/python/Python311:/cygdrive/c/Python311/Scripts:/cygdrive/c/Python311:/opt/python/3.6/bin:$BASEDIR/mingit/cmd:$BASEDIR/mingit/mingw64/libexec/git-core:$BASEDIR/git-2:$BASEDIR/npm-10/node_modules/.bin:$BASEDIR/node-v$NODE_JS_VERSION-win-x64:/opt/java/jdk16/bin:/opt/chefdk/gitbin:/cygdrive/c/cmake/bin:$PATH"
88

99
export MONGOSH_GLOBAL_CONFIG_FILE_FOR_TESTING="$BASEDIR/../../testing/tests-globalconfig.conf"
1010

@@ -18,19 +18,16 @@ if [ x"$TERM" = x"dumb" ]; then
1818
fi
1919
echo "TERM variable is set to '${TERM:-}'"
2020

21-
if [ "$OS" != "Windows_NT" ]; then
22-
if which realpath; then # No realpath on macOS, but also not needed there
23-
export HOME="$(realpath "$HOME")" # Needed to de-confuse nvm when /home is a symlink
24-
fi
25-
export NVM_DIR="$BASEDIR/.nvm"
26-
echo "Setting NVM environment home: $NVM_DIR"
27-
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
28-
set +x # nvm is very verbose
29-
echo nvm use $NODE_JS_VERSION || nvm use 20.11.1
30-
nvm use $NODE_JS_VERSION || nvm use 20.11.1 # see install-node.sh
31-
set -x
32-
export PATH="$NVM_BIN:$PATH"
21+
NODE_JS_MAJOR_VERSION=$(echo "$NODE_JS_VERSION" | awk -F . '{print $1}')
22+
if echo "$NODE_JS_MAJOR_VERSION" | grep -q '^[0-9]*$'; then
23+
export PATH="/opt/devtools/node20/bin:$PATH"
24+
node -v | grep -q "^v$NODE_JS_VERSION"
25+
else
26+
echo "Cannot identify major version from NODE_JS_VERSION: $NODE_JS_VERSION"
27+
exit 1
28+
fi
3329

30+
if [ "$OS" != "Windows_NT" ]; then
3431
if [ `uname` = Darwin ]; then
3532
echo "Using clang version:"
3633
(which clang && clang --version)

0 commit comments

Comments
 (0)