# HG changeset patch # User Steve Huston # Date 1711670791 14400 # Node ID 09e37b590785cf0e8ff711f1d04314c54d1cc2e2 # Parent 7b3dbc32eac57503886954944b43e7c265e52e07 A couple changes since some systems use different syntax diff -r 7b3dbc32eac5 -r 09e37b590785 .bash_prompt --- a/.bash_prompt Thu Mar 28 19:37:38 2024 -0400 +++ b/.bash_prompt Thu Mar 28 20:06:31 2024 -0400 @@ -42,7 +42,9 @@ fi # Set color based on clean/staged/dirty. - if [[ ${git_status} =~ "working tree clean" ]]; then + # Some versions of git say tree, some say directory + green_pattern="working (tree|directory) clean" + if [[ ${git_status} =~ ${green_pattern} ]]; then state="${GREEN}" elif [[ ${git_status} =~ "Changes to be committed" ]]; then state="${YELLOW}" @@ -51,7 +53,7 @@ fi # Set arrow icon based on status against remote. - remote_pattern="Your branch is (.*) of" + remote_pattern="Your branch is (.*)" if [[ ${git_status} =~ ${remote_pattern} ]]; then if [[ ${BASH_REMATCH[1]} == "ahead" ]]; then remote="↑"