comparison .bash_prompt @ 263:c15ff56617a9

Have to catch things a little differently, newer git output isn't the same
author Steve Huston <huston@princeton.edu>
date Mon, 08 Apr 2024 15:11:00 -0400
parents 93279b4ed0b4
children
comparison
equal deleted inserted replaced
262:93279b4ed0b4 263:c15ff56617a9
51 else 51 else
52 state="${LIGHT_RED}" 52 state="${LIGHT_RED}"
53 fi 53 fi
54 54
55 # Set arrow icon based on status against remote. 55 # Set arrow icon based on status against remote.
56 remote_pattern="Your branch is (.*)" 56 remote_pattern="Your branch is ([^${IFS}]*)"
57 if [[ ${git_status} =~ ${remote_pattern} ]]; then 57 if [[ ${git_status} =~ ${remote_pattern} ]]; then
58 if [[ ${BASH_REMATCH[1]} == "ahead" ]]; then 58 if [[ ${BASH_REMATCH[1]} == "ahead" ]]; then
59 remote="↑" 59 remote="↑"
60 elif [[ ${BASH_REMATCH[1]} == "up" ]]; then
61 remote=""
60 else 62 else
61 remote="↓" 63 remote="↓"
62 fi 64 fi
63 else 65 else
64 remote="" 66 remote=""