Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(346)

Side by Side Diff: python_git_runner.sh

Issue 188383002: Refactor the way that git executables are launched in depot tools. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: remove p Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « git-try ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 ## This file is designed to be sourced from a bash script whose name takes the
6 ## form 'git-sub-command'. This script will then instead invoke
7 ## '[depot_tools]/git_sub_command.py' correctly under mingw as well
8 ## as posix-ey systems, passing along all other command line flags.
9
10 ## Example:
11 ## echo ". python_git_runner.sh" > git-foo-command
12 ## ./git-foo-command #=> runs `python git_foo_command.py`
13
14 ## Constants
15 PYTHONDONTWRITEBYTECODE=1
16
17 ## "Input parameters".
18 # If set before the script is sourced, then we'll use the pre-set values.
19 #
20 # SCRIPT defaults to the basename of $0, with dashes replaced with underscores
21
22 if [[ $OSTYPE = msys ]]
23 then
24 DEPOT_TOOLS="${0%\\*}"
25 BASENAME="${0##*\\}"
26 else
27 DEPOT_TOOLS="${0%/*}"
28 BASENAME="${0##*/}"
29 fi
30 SCRIPT="${SCRIPT-${BASENAME//-/_}.py}"
31
32 if [[ -e "$DEPOT_TOOLS/python.bat" && $OSTYPE = msys ]]; then
33 cmd.exe //c "$DEPOT_TOOLS\\python.bat" "$DEPOT_TOOLS\\$SCRIPT" "$@"
34 else
35 exec "$DEPOT_TOOLS/$SCRIPT" "$@"
36 fi
OLDNEW
« no previous file with comments | « git-try ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698