Fix python3 wrapper for msys.

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

Bug: 1168365
Change-Id: I0c83f36f48f229276803c2e5d73ec86ecb55ada1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2721367
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@google.com>
changes/67/2721367/2
Dirk Pranke 4 years ago committed by LUCI CQ
parent 70405c2f9f
commit ea65b8412b

@ -2,6 +2,11 @@
DEPOT_TOOLS=$(dirname "$0")/..
PYTHON3_BIN_DIR="$DEPOT_TOOLS/$(cat $DEPOT_TOOLS/python3_bin_reldir.txt | xargs echo)"
if [ "$OSTYPE" = "msys" ]
then
PYTHON3_BIN_DIR="$DEPOT_TOOLS/$(sed -e 's-\\-/-g' $DEPOT_TOOLS/python3_bin_reldir.txt)"
else
PYTHON3_BIN_DIR="$DEPOT_TOOLS/$(cat $DEPOT_TOOLS/python3_bin_reldir.txt)"
fi
PATH="$PYTHON3_BIN_DIR":"$PYTHON3_BIN_DIR/Scripts":"$PATH"
"$PYTHON3_BIN_DIR/python3" "$@"

Loading…
Cancel
Save