OLD | NEW |
---|---|
(Empty) | |
1 #!/bin/bash | |
agable
2014/02/28 19:54:58
Make 'git cl' and 'git cache' use this.
| |
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 'git_sub_command .py' | |
agable
2014/02/28 19:54:58
80 chars? (It's wrapping on Rietveld but I'm too l
iannucci
2014/03/06 00:18:39
Oh, weird. I think this is my bad. Done.
| |
8 ## correctly under mingw as well as posix-ey systems, passing along all other | |
9 ## command line flags. | |
10 | |
11 ## Example: | |
12 ## echo ". python_git_runner.sh" > git-foo-command | |
13 ## ./git-foo-command #=> runs `python git_foo_command.py` | |
14 | |
15 OUTPUT="$(uname | grep 'MINGW')" | |
16 MINGW=$? | |
17 | |
18 BASE="$(basename "$0")" | |
19 SCRIPT="${BASE//-/_}.py" | |
20 | |
21 if [ $MINGW = 0 ]; then | |
22 base_dir="${0%\\*}" | |
23 else | |
24 base_dir=$(dirname "$0") | |
25 fi | |
26 | |
27 if [ -e "$base_dir/python.bat" -a $MINGW = 0 ]; then | |
28 PYTHONDONTWRITEBYTECODE=1 cmd.exe //c "$base_dir\\python.bat" "$base_dir\\$SCR IPT" "$@" | |
29 else | |
30 PYTHONDONTWRITEBYTECODE=1 exec "$base_dir/$SCRIPT" "$@" | |
31 fi | |
OLD | NEW |