Files
Fumitoshi Ukai e6596746dc better error message from python3 when not initialized
Bug: 414330998
Change-Id: I47fcd9571ba3de0a080e31624f9bdf0fa738914a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6498079
Auto-Submit: Fumitoshi Ukai <ukai@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2025-04-30 10:26:53 -07:00

21 lines
564 B
Bash
Executable File

#!/usr/bin/env bash
DEPOT_TOOLS=$(dirname "$0")/..
if [[ ! -f "$DEPOT_TOOLS/python3_bin_reldir.txt" ]]; then
cat >&2 <<EOF
python3_bin_reldir.txt not found. need to initialize depot_tools by
running gclient, update_depot_tools or ensure_bootstrap.
EOF
exit 1
fi
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/$(<"$DEPOT_TOOLS/python3_bin_reldir.txt")"
fi
PATH="$PYTHON3_BIN_DIR":"$PYTHON3_BIN_DIR/Scripts":"$PATH"
"$PYTHON3_BIN_DIR/python3" "$@"