blob: 08ed05bafc6907d332c5a36bd9570111a9268a0a [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")}"
Robert Iannuccifc40ad22018-02-20 16:49:12 -080040
Mike Frysinger248aa8b2023-08-03 22:05:10 +000041source "${DEPOT_TOOLS_DIR}/cipd_bin_setup.sh"
Dan Jacques5aeeb722017-07-28 15:22:25 +020042cipd_bin_setup &> /dev/null
Sergey Berezin6fee2672017-05-01 15:31:16 -070043
Mike Frysinger029025a2023-08-03 06:58:27 +000044case $(uname -s) in
45MINGW*|CYGWIN*)
Mike Frysinger5260b2b2021-03-30 02:09:47 +000046 cmd.exe //c $0.bat "$@"
Mike Frysinger029025a2023-08-03 06:58:27 +000047 ;;
48*)
Mike Frysinger248aa8b2023-08-03 22:05:10 +000049 exec "${DEPOT_TOOLS_DIR}/.cipd_bin/vpython" "$@"
Mike Frysinger029025a2023-08-03 06:58:27 +000050 ;;
51esac