OLD | NEW |
---|---|
(Empty) | |
1 #!/bin/bash | |
agable
2014/03/06 18:09:07
This will vanish when this CL gets rebased on top
| |
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 ## 'git_sub_command.py' correctly under mingw as well as posix-ey systems, | |
9 ## 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 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 |