Robert Nagy | 059f26b | 2019-05-10 14:58:03 +0000 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Sergey Berezin | 6fee267 | 2017-05-01 15:31:16 -0700 | [diff] [blame] | 2 | |
Robert Iannucci | fc40ad2 | 2018-02-20 16:49:12 -0800 | [diff] [blame] | 3 | # Copyright 2018 The Chromium Authors. All rights reserved. |
Sergey Berezin | 6fee267 | 2017-05-01 15:31:16 -0700 | [diff] [blame] | 4 | # Use of this source code is governed by a BSD-style license that can be |
| 5 | # found in the LICENSE file. |
| 6 | |
Nodir Turakulov | 47a4b0b | 2021-05-13 23:58:10 +0000 | [diff] [blame] | 7 | # See revert instructions in cipd_manifest.txt |
| 8 | |
Robert Iannucci | fc40ad2 | 2018-02-20 16:49:12 -0800 | [diff] [blame] | 9 | if [[ $VPYTHON_BYPASS == "manually managed python not supported by chrome operations" ]] |
| 10 | then |
| 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[@]}" |
| 36 | fi |
| 37 | |
| 38 | |
John Budorick | 6ec8b51 | 2019-11-19 15:49:52 +0000 | [diff] [blame] | 39 | base_dir=$(dirname "$0") |
Sergey Berezin | 6fee267 | 2017-05-01 15:31:16 -0700 | [diff] [blame] | 40 | |
John Budorick | 6ec8b51 | 2019-11-19 15:49:52 +0000 | [diff] [blame] | 41 | source "$base_dir/cipd_bin_setup.sh" |
Dan Jacques | 5aeeb72 | 2017-07-28 15:22:25 +0200 | [diff] [blame] | 42 | cipd_bin_setup &> /dev/null |
Sergey Berezin | 6fee267 | 2017-05-01 15:31:16 -0700 | [diff] [blame] | 43 | |
Mike Frysinger | 5260b2b | 2021-03-30 02:09:47 +0000 | [diff] [blame] | 44 | if [[ $(uname -s) = MINGW* || $(uname -s) = CYGWIN* ]]; then |
| 45 | cmd.exe //c $0.bat "$@" |
Mike Frysinger | 5260b2b | 2021-03-30 02:09:47 +0000 | [diff] [blame] | 46 | else |
| 47 | exec "$base_dir/.cipd_bin/vpython" "$@" |
| 48 | fi |