diff options
| author | tslil clingman <> | 2019-02-02 22:23:08 -0500 |
|---|---|---|
| committer | tslil clingman <> | 2019-02-02 22:23:08 -0500 |
| commit | 3fa6b4c911483ea08cfef48fdb81348a8759c9b7 (patch) | |
| tree | b73a690d262b8181c01bb0559a290f4e5854d5ab | |
| parent | 893ceb06cb5b1745dde71d9880b519a8d9503a4e (diff) | |
Cleanup, goodbye ZSH cruft and Darcs
| -rwxr-xr-x | vcs | 55 |
1 files changed, 10 insertions, 45 deletions
@@ -11,58 +11,23 @@ VCS_MOD="" VCS_REC="" SPC="" -if [ "$1" = "--zsh-colour" ]; then - nstr="%F{red}●%f" - mstr="%F{11}●%f" - rstr="%F{28}●%f" - cFST="%F{green}" - cSND="%F{blue}" - cEND="%f" -else - nstr="@" - mstr="±" - rstr="↑" - cFST="" - cSND="" - cEND="" -fi - if [ -d ".git" ] || [ -d "../.git" ] || [ -d "../../.git" ]; then outp=$(git status) - VCS_STR="*" - VCS_INF=$(echo "$outp" | head -n 1 | cut -d' ' -f 3-) + VCS_STR="×" + VCS_INF="$(echo "$outp" | head -n 1 | cut -d' ' -f 3-)" if check "^Untracked files:$" "$outp"; then - VCS_NEW=$nstr + VCS_NEW="*" fi; if check "^Changes not staged for commit:$" "$outp"; then - VCS_MOD=$mstr + VCS_MOD="±" fi; if check "^Changes to be committed:$" "$outp"; then - VCS_REC=$rstr - fi; -elif [ -d "_darcs" ] || [ -d "../_darcs" ] || [ -d "../../_darcs" ]; then - fls=$(darcs show files) - VCS_STR="+" - VCS_INF=$(darcs show repo | grep Default | cut -d : -f 3-) - for f in ./*; do - if [ -f "$f" ]; then - echo "$fls" | grep -q "$f" - else - true - fi; - if [ ! $? = 0 ]; then - VCS_NEW=$nstr; - break; - fi; - done; - news=$(darcs what)$ - if check "^No changes" "$news"; then - true - else - VCS_REC=$rstr; + VCS_REC="↑" fi; - fi; -[ -n "$VCS_NEW$VCS_MOD$VCS_REC" ] && SPC=" " -[ -n "$VCS_STR" ] && echo "$cFST$VCS_STR$cEND{$cSND$VCS_INF$cEND$SPC$VCS_NEW$VCS_MOD$VCS_REC}" +if [ -n "$VCS_STR" ]; then + flags="$VCS_NEW$VCS_MOD$VCS_REC"; + [ -n "$flags" ] && SPC=" " + echo "$VCS_STR{$VCS_INF$SPC$flags}" +fi; |
