potentially finished git status script for bash prompt

This commit is contained in:
Solomon Laing 2022-06-04 18:34:04 +09:30
parent 8ce549de21
commit 11e0e56489

View File

@ -7,9 +7,11 @@ if git status &>/dev/null; then
to_push=${counts[0]}
to_pull=${counts[1]}
extras=$([[ ${counts[0]} -eq 0 && ${counts[1]} -eq 0 ]] || echo " $to_push↑ $to_pull↓")
if [[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]]; then
echo "($branch* $to_push↑ $to_pull↓)"
echo "($branch*$extras)"
else
echo "($branch~ $to_push↑ $to_pull↓)"
echo "($branch~$extras)"
fi
fi