blob: 42d112fa7c3bd2929c315863be25eb8d91059336 [file] [log] [blame]
Robert Nagy059f26b2019-05-10 14:58:03 +00001#!/usr/bin/env bash
Sergey Berezin6fee2672017-05-01 15:31:16 -07002
Robert Iannuccifc40ad22018-02-20 16:49:12 -08003# Copyright 2018 The Chromium Authors. All rights reserved.
Sergey Berezin6fee2672017-05-01 15:31:16 -07004# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
Nodir Turakulov47a4b0b2021-05-13 23:58:10 +00007# See revert instructions in cipd_manifest.txt
8
Robert Iannuccifc40ad22018-02-20 16:49:12 -08009if [[ $VPYTHON_BYPASS == "manually managed python not supported by chrome operations" ]]
10then
11 NEWARGS=()
12 while [[ $# -gt 0 ]]
13 do
14 case "$1" in
15 -vpython-tool*) # these tools all do something vpython related and quit
16 exit 0
17 ;;
18 -vpython*=*) # delete any vpython-specific flag (w/ attached argument)
19 shift
20 ;;
21 -vpython*) # delete any vpython-specific flag (w/ separate argument)
22 shift
23 shift
24 ;;
25 --) # stop parsing
26 NEWARGS+=( "$@" )
27 break
28 ;;
29 *) # regular arg
30 NEWARGS+=( "$1" )
31 shift
32 ;;
33 esac
34 done
35 exec "python" "${NEWARGS[@]}"
36fi
37
Mike Frysinger248aa8b2023-08-03 22:05:10 +000038# Export for other depot_tools scripts to re-use.
39export DEPOT_TOOLS_DIR="${DEPOT_TOOLS_DIR:-$(dirname "$0")}"
Mike Frysingerb9b690e2023-08-04 18:11:57 +000040export DEPOT_TOOLS_UNAME_S="${DEPOT_TOOLS_UNAME_S:-$(uname -s | tr '[:upper:]' '[:lower:]')}"
Robert Iannuccifc40ad22018-02-20 16:49:12 -080041
Mike Frysinger248aa8b2023-08-03 22:05:10 +000042source "${DEPOT_TOOLS_DIR}/cipd_bin_setup.sh"
Dan Jacques5aeeb722017-07-28 15:22:25 +020043cipd_bin_setup &> /dev/null
Sergey Berezin6fee2672017-05-01 15:31:16 -070044
Mike Frysingerb9b690e2023-08-04 18:11:57 +000045case "${DEPOT_TOOLS_UNAME_S}" in
46mingw*|cygwin*)
Mike Frysinger5260b2b2021-03-30 02:09:47 +000047 cmd.exe //c $0.bat "$@"
Mike Frysinger029025a2023-08-03 06:58:27 +000048 ;;
49*)
Mike Frysinger248aa8b2023-08-03 22:05:10 +000050 exec "${DEPOT_TOOLS_DIR}/.cipd_bin/vpython" "$@"
Mike Frysinger029025a2023-08-03 06:58:27 +000051 ;;
52esac