diff options
| author | Tslil Clingman <hiato1@gmail.com> | 2015-01-30 23:22:18 +0200 |
|---|---|---|
| committer | Tslil Clingman <hiato1@gmail.com> | 2015-01-30 23:22:18 +0200 |
| commit | 2a30d923196c135f5d02e56e3e840d2d1fb3140e (patch) | |
| tree | 8c087cf0f7336cd10ee9e503e373095ed5f34e9e /vcs | |
| parent | 2dc2feacf35cfebade39b2e2797e02ac6d84c4c4 (diff) | |
VCS should now be sh(1) compatible
Diffstat (limited to 'vcs')
| -rwxr-xr-x | vcs | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -1,7 +1,7 @@ -#!/bin/zsh +#!/usr/bin/env sh check() { - echo $1 | grep -q $2; + echo "$2" | grep -q "$1"; }; VCS_STR="" @@ -17,12 +17,12 @@ rstr=" %F{28}●%f" if [[ -d ".git" || -d "../.git" || -d "../../.git" ]]; then outp=$(git status) VCS_STR="×" - VCS_INF=$(echo $outp | head -n 1 | cut -d' ' -f 3-) - check $outp "^Untracked files:$" + VCS_INF=$(echo "$outp" | head -n 1 | cut -d' ' -f 3-) + check "^Untracked files:$" "$outp" [[ $? = 0 ]] && VCS_NEW=$nstr - check $outp "^Changes not staged for commit:$" + check "^Changes not staged for commit:$" "$outp" [[ $? = 0 ]] && VCS_MOD=$mstr - check $outp "^Changes to be committed:$" + check "^Changes to be committed:$" "$outp" [[ $? = 0 ]] && VCS_REC=$rstr else if [[ -d "_darcs" || -d "../_darcs" || -d "../../_darcs" ]]; then fls=$(darcs show files) @@ -30,7 +30,7 @@ else if [[ -d "_darcs" || -d "../_darcs" || -d "../../_darcs" ]]; then VCS_INF=$(darcs show repo | grep Default | cut -d : -f 3-) for f in ./*; do if [[ -f $f ]]; then - echo $fls | grep -q $f + echo "$fls" | grep -q $f else true fi; @@ -40,7 +40,7 @@ else if [[ -d "_darcs" || -d "../_darcs" || -d "../../_darcs" ]]; then fi; done; news=$(darcs what)$ - check $news "^No changes" + check "^No changes" "$news" [[ $? = 0 ]] || VCS_REC=$rstr fi; fi; |
