1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
#!/bin/sh
# Windows doesn't have the 'dirname' command, so fake it
dirname() {
dir=$(echo "$@" | perl -pe 's,(.*)/[^/]+,\1,')
test "$dir" = "$1" && dir=.
echo "$dir"
}
mydir="$(dirname "$0")"
parentdir="$(dirname "$mydir")"
# Windows uses 'git-cola.pyw' instead of 'git-cola'
COLA="$parentdir"/bin/git-cola
if test -f "$COLA".pyw; then
COLA="$COLA".pyw
fi
# The path to python can be specified by setting the
# PYTHON environment variable.
if test -z "$PYTHON"
then
PYTHON="$(which python.exe 2>/dev/null)"
fi
# The path to python can be specified in the
# `cola.pythonlocation` git configuration variable.
if test -z "$PYTHON"
then
PYTHON="$(git config cola.pythonlocation)"
fi
if test -n "$PYTHON"
then
exec "$PYTHON" "$COLA" "$@"
fi
# Find a suitable Python and use it to run cola.
# If your python is installed in another location then
# add that path to the top of the list below or
# set the `cola.pythonlocation` git configuration variable.
for python in \
"/c/Python312" \
"/c/Python311" \
"/c/Python310" \
"/c/Python39" \
"/c/Python38" \
"/c/Python37" \
"/c/Python36" \
"/c/Python35" \
"/c/Python34"
do
if test -d "$python"
then
PATH="$python":"$PATH" exec "$python/python.exe" "$COLA" "$@"
fi
done
exit 1
|