blob: 45b0d02b58a97ae34f95a7b28ec1edff11ddb4f6 [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
38
John Budorick6ec8b512019-11-19 15:49:52 +000039base_dir=$(dirname "$0")
Sergey Berezin6fee2672017-05-01 15:31:16 -070040
John Budorick6ec8b512019-11-19 15:49:52 +000041source "$base_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 Frysinger5260b2b2021-03-30 02:09:47 +000049 exec "$base_dir/.cipd_bin/vpython" "$@"
Mike Frysinger029025a2023-08-03 06:58:27 +000050 ;;
51esac