maruel@chromium.org | 3bb0d6f | 2010-11-15 17:01:52 +0000 | [diff] [blame] | 1 | #!/usr/bin/env bash |
maruel@google.com | fb2b8eb | 2009-04-23 21:03:42 +0000 | [diff] [blame] | 2 | # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
| 5 | |
maruel@google.com | fb2b8eb | 2009-04-23 21:03:42 +0000 | [diff] [blame] | 6 | base_dir=$(dirname "$0") |
maruel@chromium.org | 522ca09 | 2009-06-17 18:35:18 +0000 | [diff] [blame] | 7 | |
Edward Lesmes | 7149d23 | 2019-08-12 21:04:04 +0000 | [diff] [blame] | 8 | if [[ "#grep#fetch#cleanup#diff#setdep#" != *"#$1#"* ]]; then |
Edward Lemur | b9aca94 | 2019-10-01 22:13:03 +0000 | [diff] [blame^] | 9 | # Shall skip authomatic update? |
| 10 | if [[ $DEPOT_TOOLS_UPDATE != 0 ]]; then |
| 11 | "$base_dir"/update_depot_tools "$@" |
| 12 | case $? in |
| 13 | 123) |
| 14 | # msys environment was upgraded, need to quit. |
| 15 | exit 0 |
| 16 | ;; |
| 17 | 0) |
| 18 | ;; |
| 19 | *) |
| 20 | exit $? |
| 21 | esac |
| 22 | fi |
ilevy@chromium.org | 3addce3 | 2012-11-08 23:02:13 +0000 | [diff] [blame] | 23 | fi |
maruel@chromium.org | 522ca09 | 2009-06-17 18:35:18 +0000 | [diff] [blame] | 24 | |
Edward Lemur | 3905857 | 2019-09-27 21:47:49 +0000 | [diff] [blame] | 25 | # Ensure that "depot_tools" is somewhere in PATH so this tool can be used |
| 26 | # standalone, but allow other PATH manipulations to take priority. |
| 27 | PATH=$PATH:$base_dir |
| 28 | |
| 29 | if [[ $GCLIENT_PY3 == 1 ]]; then |
| 30 | PYTHONDONTWRITEBYTECODE=1 exec vpython3 "$base_dir/gclient.py" "$@" |
| 31 | else |
| 32 | PYTHONDONTWRITEBYTECODE=1 exec python "$base_dir/gclient.py" "$@" |
| 33 | fi |