Skip to content

Commit 31773c1

Browse files
committed
Merge branch 'master' of github.com:maddingo/bash-git-prompt into maddingo-master
Conflicts: gitprompt.sh
2 parents 71ab709 + f36da50 commit 31773c1

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

gitprompt.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
#!/bin/sh
22

3+
# assume the gitstatus.py is in the same directory as this script
4+
# code thanks to http://stackoverflow.com/questions/59895
5+
if [ -z "${__GIT_PROMPT_DIR}" ]; then
6+
SOURCE="${BASH_SOURCE[0]}"
7+
while [ -h "${SOURCE}" ]; do
8+
DIR="$( cd -P "$( dirname "${SOURCE}" )" && pwd )"
9+
SOURCE="$(readlink "${SOURCE}")"
10+
[[ $SOURCE != /* ]] && SOURCE="${DIR}/${SOURCE}"
11+
done
12+
__GIT_PROMPT_DIR="$( cd -P "$( dirname "${SOURCE}" )" && pwd )"
13+
fi
14+
315
function git_prompt_config()
416
{
517
# Colors
@@ -34,7 +46,9 @@ function git_prompt_config()
3446
GIT_PROMPT_CLEAN="${BoldGreen}"
3547

3648
# Various variables you might want for your PS1 prompt instead
37-
local Time12a="\@"
49+
local Time12a="\$(date +%H:%M)"
50+
# local Time12a="(\$(date +%H:%M:%S))"
51+
# local Time12a="(\@))"
3852
local PathShort="\w"
3953

4054
PROMPT_START="${Yellow}${PathShort}${ResetColor}"

0 commit comments

Comments
 (0)