Add basic PS1 support for got.
This commit is contained in:
parent
c127e14d46
commit
4cbf7e178d
@ -16,3 +16,12 @@ function got-push {
|
||||
(cd "$r" && git push "$@")
|
||||
}
|
||||
|
||||
function __got_ps1 {
|
||||
local _format _branch _status
|
||||
_format=$1
|
||||
_branch=$(got branch 2>/dev/null | grep -v conf_set_now)
|
||||
_status=$?
|
||||
if [ $_status == 0 ]; then
|
||||
printf "$_format" $_branch
|
||||
fi
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
load_extension git-prompt
|
||||
load_extension got
|
||||
|
||||
PS1='\u@\h[\[\e[01;$(($??31:39))m\]$?\[\e[0m]\]:\w\]$(__git_ps1 " (%s)")\$ '
|
||||
PS1='\u@\h[\[\e[01;$(($??31:39))m\]$?\[\e[0m]\]:\w\]$(__got_ps1 " got:(%s)")$(__git_ps1 " git:(%s)")\$ '
|
||||
|
||||
export PS1
|
||||
|
Loading…
Reference in New Issue
Block a user