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

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: 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
« gitscripts/git_cl.py ('K') | « gitscripts/git_try.py ('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 #!/bin/bash
2 # Copyright (c) 2014 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
6 ## This file is designed to be sourced from a bash script whose name takes the
7 ## form 'git-sub-command'. This script will then instead invoke
8 ## '[depot_tools]/gitscripts/git_sub_command.py' correctly under mingw as well
9 ## as posix-ey systems, passing along all other command line flags.
10
11 ## Example:
12 ## echo ". python_git_runner.sh" > git-foo-command
13 ## ./git-foo-command #=> runs `python gitscripts/git_foo_command.py`
14
15 ## Constants
16 PYTHONDONTWRITEBYTECODE=1
17 SUBDIR=gitscripts
18 BASE="$(basename "$0")"
19
20 ## "Input parameters".
21 # If set before the script is sourced, then we'll use the pre-set values.
22 # SCRIPT defaults to the basename of $0, with dashes replaced with underscores
23 SCRIPT="${SCRIPT-${BASE//-/_}.py}"
24
25 OUTPUT="$(uname | grep 'MINGW')"
26 MINGW=$?
27
28 if [ $MINGW = 0 ]; then
29 base_dir="${0%\\*}"
30 else
31 base_dir=$(dirname "$0")
32 fi
33
34 if [ -e "$base_dir/python.bat" -a $MINGW = 0 ]; then
35 cmd.exe //c "$base_dir\\python.bat" "$base_dir\\$SUBDIR\\$SCRIPT" "$@"
36 else
37 exec "$base_dir/$SUBDIR/$SCRIPT" "$@"
38 fi
OLDNEW
« gitscripts/git_cl.py ('K') | « gitscripts/git_try.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698