script works for any installation directory

master
Martin Goldhahn 13 years ago
parent 48eff2e073
commit 56e9e243a3
  1. 14
      gitprompt.sh

@ -1,6 +1,14 @@
if [ "x$__GIT_PROMPT_DIR" == "x" ] #!/bin/bash
then # assume the gitstatus.py is in the same directory as this script
__GIT_PROMPT_DIR=~/.bash # code thanks to http://stackoverflow.com/questions/59895
if [ -z "$__GIT_PROMPT_DIR" ] ; then
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ] ; do
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
__GIT_PROMPT_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
fi fi
# Colors # Colors

Loading…
Cancel
Save