OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 ## This file is designed to be sourced from a bash script whose name takes the | 5 ## This file is designed to be sourced from a bash script whose name takes the |
6 ## form 'command-name'. This script will then instead invoke | 6 ## form 'command-name'. This script will then instead invoke |
7 ## '[depot_tools]/command_name.py' correctly under mingw as well | 7 ## '[depot_tools]/command_name.py' correctly under mingw as well |
8 ## as posix-ey systems, passing along all other command line flags. | 8 ## as posix-ey systems, passing along all other command line flags. |
9 | 9 |
10 ## Example: | 10 ## Example: |
(...skipping 23 matching lines...) Expand all Loading... |
34 # within the depot_tools dir itself). In that case, treat it as if run like: | 34 # within the depot_tools dir itself). In that case, treat it as if run like: |
35 # "./command" | 35 # "./command" |
36 DEPOT_TOOLS="." | 36 DEPOT_TOOLS="." |
37 BASENAME="$0" | 37 BASENAME="$0" |
38 else | 38 else |
39 BASENAME="${0##*/}" | 39 BASENAME="${0##*/}" |
40 fi | 40 fi |
41 else | 41 else |
42 BASENAME="${0##*\\}" | 42 BASENAME="${0##*\\}" |
43 fi | 43 fi |
| 44 |
44 SCRIPT="${SCRIPT-${BASENAME//-/_}.py}" | 45 SCRIPT="${SCRIPT-${BASENAME//-/_}.py}" |
45 | 46 |
46 if [[ -e "$DEPOT_TOOLS/python.bat" && $OSTYPE = msys ]]; then | 47 if [[ $PYTHON_DIRECT = 1 ]]; then |
47 cmd.exe //c "$DEPOT_TOOLS\\python.bat" "$DEPOT_TOOLS\\$SCRIPT" "$@" | 48 python.exe "$DEPOT_TOOLS\\$SCRIPT" "$@" |
48 else | 49 else |
49 exec "$DEPOT_TOOLS/$SCRIPT" "$@" | 50 if [[ -e "$DEPOT_TOOLS/python.bat" && $OSTYPE = msys ]]; then |
| 51 cmd.exe //c "$DEPOT_TOOLS\\python.bat" "$DEPOT_TOOLS\\$SCRIPT" "$@" |
| 52 else |
| 53 exec "$DEPOT_TOOLS/$SCRIPT" "$@" |
| 54 fi |
50 fi | 55 fi |
OLD | NEW |