summaryrefslogtreecommitdiff
path: root/vcs
diff options
context:
space:
mode:
Diffstat (limited to 'vcs')
-rwxr-xr-xvcs16
1 files changed, 8 insertions, 8 deletions
diff --git a/vcs b/vcs
index d68d07c..cf72f04 100755
--- a/vcs
+++ b/vcs
@@ -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;