fix uniq paranthesis
This commit is contained in:
parent
a22083d54a
commit
1295ed60cf
1 changed files with 2 additions and 2 deletions
4
PS1
4
PS1
|
@ -1,11 +1,11 @@
|
||||||
# /etc/profile.d/PS1.sh: executed by Bourne-compatible login shells.
|
# /etc/profile.d/PS1.sh: executed by Bourne-compatible login shells.
|
||||||
|
|
||||||
parse_git_branch() {
|
parse_git_branch() {
|
||||||
local LBRANCH="$(git branch 2>/dev/null | sed -ne 's/* \(.*\)/ \1/p'|sed -e 's/^[[:blank:]]*//;s/[[:blank:]]*$//'|tr -s '()')"
|
local LBRANCH="$(git branch 2>/dev/null | sed -ne 's/* \(.*\)/ \1/p'|sed -e 's/^[[:blank:]]*//;s/[[:blank:]]*$//')"
|
||||||
local RBRANCH="$( git rev-parse --symbolic-full-name --abbrev-ref @{u} 2>/dev/null |sed -e 's/^[[:blank:]]*//' )"
|
local RBRANCH="$( git rev-parse --symbolic-full-name --abbrev-ref @{u} 2>/dev/null |sed -e 's/^[[:blank:]]*//' )"
|
||||||
[ -z "${RBRANCH-x}" ] && unset RBRANCH
|
[ -z "${RBRANCH-x}" ] && unset RBRANCH
|
||||||
local BRANCH="${LBRANCH}${RBRANCH+ -> }${RBRANCH}"
|
local BRANCH="${LBRANCH}${RBRANCH+ -> }${RBRANCH}"
|
||||||
[ -z "${BRANCH-x}" ] || echo "($BRANCH)"
|
[ -z "${BRANCH-x}" ] || echo "($BRANCH)|tr -s '()'"
|
||||||
}
|
}
|
||||||
|
|
||||||
set_label() {
|
set_label() {
|
||||||
|
|
Loading…
Reference in a new issue