2 # Windows doesn't have the 'dirname' command, so fake it
4 dir
=$
(echo "$@" | perl
-pe 's,(.*)/[^/]+,\1,')
5 test "$dir" = "$1" && dir
=.
9 mydir
="$(dirname "$0")"
10 parentdir
="$(dirname "$mydir")"
12 # Windows uses 'git-cola.pyw' instead of 'git-cola'
13 COLA
="$parentdir"/bin
/git-cola
14 if test -f "$COLA".pyw
; then
18 # The path to python can be specified by setting the
19 # PYTHON environment variable.
22 PYTHON
="$(which python.exe 2>/dev/null)"
24 # The path to python can be specified in the
25 # `cola.pythonlocation` git configuration variable.
28 PYTHON
="$(git config cola.pythonlocation)"
32 exec "$PYTHON" "$COLA" "$@"
35 # Find a suitable Python and use it to run cola.
36 # If your python is installed in another location then
37 # add that path to the top of the list below or
38 # set the `cola.pythonlocation` git configuration variable.
52 PATH
="$python":"$PATH" exec "$python/python.exe" "$COLA" "$@"