Files
chromium_depot_tools/python-bin/python3
Dirk Pranke ea65b8412b 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>
2021-03-02 22:03:10 +00:00

13 lines
349 B
Bash
Executable File

#!/usr/bin/env bash
DEPOT_TOOLS=$(dirname "$0")/..
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" "$@"