Skip to content

Commit a7d7ff1

Browse files
committed
fix windows handling
1 parent a4d4b4c commit a7d7ff1

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

.evergreen/scripts/configure-env.sh

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,6 @@ if [ "Windows_NT" = "${OS:-}" ]; then # Magic variable in cygwin
4141
PYMONGO_BIN_DIR=$(cygpath -m "$PYMONGO_BIN_DIR")
4242
fi
4343

44-
# If the toolchain is available, symlink binaries to the bin dir.
45-
_bin_path=""
46-
if [ "Windows_NT" == "${OS:-}" ]; then
47-
_bin_path="/cygdrive/c/Python/Current/Scripts"
48-
elif [ "$(uname -s)" != "Darwin" ]; then
49-
_bin_path="/Library/Frameworks/Python.Framework/Versions/Current/bin"
50-
else
51-
_bin_path="/opt/python/Current/bin"
52-
fi
53-
if [ -d "${_bin_path}" ]; then
54-
_suffix=""
55-
if [ "Windows_NT" == "${OS:-}" ]; then
56-
_suffix=".exe"
57-
fi
58-
ln -s ${_bin_path}/just${_suffix} $PYMONGO_BIN_DIR/just${_suffix}
59-
ln -s ${_bin_path}/uv${_suffix} $PYMONGO_BIN_DIR/uv${_suffix}
60-
ln -s ${_bin_path}/uvx${_suffix} $PYMONGO_BIN_DIR/uvx${_suffix}
61-
fi
62-
6344
SCRIPT_DIR="$PROJECT_DIRECTORY/.evergreen/scripts"
6445

6546
if [ -f "$SCRIPT_DIR/env.sh" ]; then
@@ -97,8 +78,6 @@ EOT
9778
rm -rf $DRIVERS_TOOLS
9879
BRANCH=master
9980
ORG=mongodb-labs
100-
BRANCH=PYTHON-5203
101-
ORG=blink1073
10281
git clone --branch $BRANCH https://github.com/$ORG/drivers-evergreen-tools.git $DRIVERS_TOOLS
10382

10483
cat <<EOT > ${DRIVERS_TOOLS}/.env
@@ -113,3 +92,24 @@ cat <<EOT > expansion.yml
11392
DRIVERS_TOOLS: "$DRIVERS_TOOLS"
11493
PROJECT_DIRECTORY: "$PROJECT_DIRECTORY"
11594
EOT
95+
96+
# If the toolchain is available, symlink binaries to the bin dir. This has to be done
97+
# after drivers-tools is cloned, since we might be using its binary dir.
98+
_bin_path=""
99+
if [ "Windows_NT" == "${OS:-}" ]; then
100+
_bin_path="/cygdrive/c/Python/Current/Scripts"
101+
elif [ "$(uname -s)" != "Darwin" ]; then
102+
_bin_path="/Library/Frameworks/Python.Framework/Versions/Current/bin"
103+
else
104+
_bin_path="/opt/python/Current/bin"
105+
fi
106+
if [ -d "${_bin_path}" ]; then
107+
_suffix=""
108+
if [ "Windows_NT" == "${OS:-}" ]; then
109+
_suffix=".exe"
110+
fi
111+
mkdir -p $PYMONGO_BIN_DIR
112+
ln -s ${_bin_path}/just${_suffix} $PYMONGO_BIN_DIR/just${_suffix}
113+
ln -s ${_bin_path}/uv${_suffix} $PYMONGO_BIN_DIR/uv${_suffix}
114+
ln -s ${_bin_path}/uvx${_suffix} $PYMONGO_BIN_DIR/uvx${_suffix}
115+
fi

0 commit comments

Comments
 (0)