Commit 2e149f26 authored by Dirk Pranke's avatar Dirk Pranke Committed by LUCI CQ

Fix python2 wrapper for msys.

The python_bin_reldir.txt path to find the python2 binary will
contain backslashes instead of forward slashes on Windows, so
this tweaks the wrapper in //python2-bin/python2 to handle that
and start working under msys.

Bug: 1168365
Change-Id: If0876054f0a73c9a53a1eb23ea03c60c1e756c29
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2729410
Commit-Queue: Dirk Pranke <dpranke@google.com>
Reviewed-by: 's avatarJosip Sokcevic <sokcevic@google.com>
parent bf0766c3
......@@ -2,6 +2,13 @@
DEPOT_TOOLS=$(dirname "$0")/..
PYTHON_BIN_DIR="$DEPOT_TOOLS/$(cat $DEPOT_TOOLS/python_bin_reldir.txt | xargs echo)"
if [ "$OSTYPE" = "msys" ]
then
# msys is `git bash` on windows, so python_bin_reldir contains backslashes;
# this converts them to the forward slashes a unix environment expects.
PYTHON_BIN_DIR="$DEPOT_TOOLS/$(sed -e 's-\\-/-g' $DEPOT_TOOLS/python_bin_reldir.txt)"
else
PYTHON_BIN_DIR="$DEPOT_TOOLS/$(cat $DEPOT_TOOLS/python_bin_reldir.txt)"
fi
PATH="$PYTHON_BIN_DIR":"$PATH"
"$PYTHON_BIN_DIR/python" "$@"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment