blob: 0118ae89553c99f21f3e0827e47ca7c7b607e265 (
plain)
1
2
3
4
5
6
7
8
|
#!/bin/sh
BRANCH=$(git branch --show-current 2>/dev/null)
BRANCH=$(test -d .git && test -n $BRANCH && echo "($BRANCH)")
PROMPT="$USER@$(hostname):$( test $PWD = $HOME && echo '~' || basename "$PWD")$BRANCH"
case $(id -u) in
0) echo "$PROMPT# " ;;
*) echo "$PROMPT$ " ;;
esac
|