fix uniq paranthesis

This commit is contained in:
Jakobus Schürz 2020-07-14 08:23:59 +02:00
parent a22083d54a
commit 1295ed60cf

4
PS1
View file

@ -1,11 +1,11 @@
# /etc/profile.d/PS1.sh: executed by Bourne-compatible login shells.
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:]]*//' )"
[ -z "${RBRANCH-x}" ] && unset RBRANCH
local BRANCH="${LBRANCH}${RBRANCH+ -> }${RBRANCH}"
[ -z "${BRANCH-x}" ] || echo "($BRANCH)"
[ -z "${BRANCH-x}" ] || echo "($BRANCH)|tr -s '()'"
}
set_label() {