summaryrefslogtreecommitdiff
path: root/Biz/Ide/hooks
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2023-09-19 21:15:00 -0400
committerBen Sima <ben@bsima.me>2023-09-19 21:15:00 -0400
commita650898420953e45abc3f2ae20de5fffa6366049 (patch)
tree5bf56277cc3436aca5b85957ab3fce6e14a198de /Biz/Ide/hooks
parentffe3fd8a719be8d02b03bac6bc8232a7bc9fa692 (diff)
Fix checking of grep exitcode
This is one of those things that's hard to get right because it depends on the state of the git repo to exercise all code paths.
Diffstat (limited to 'Biz/Ide/hooks')
-rwxr-xr-xBiz/Ide/hooks/pre-push9
1 files changed, 6 insertions, 3 deletions
diff --git a/Biz/Ide/hooks/pre-push b/Biz/Ide/hooks/pre-push
index 863c687..baf7a13 100755
--- a/Biz/Ide/hooks/pre-push
+++ b/Biz/Ide/hooks/pre-push
@@ -19,9 +19,12 @@
commit=$(git notes --ref=ci show $local_ref || true)
if [[ -n "$commit" ]]
then
- lint_ok=$(grep "Lint-is: good" <<< $commit)
- test_ok=$(grep "Test-is: good" <<< $commit)
- if [[ $lint_ok -eq 0 || $test_ok -eq 0 ]]
+ lint_ok=$()
+ if grep -q "Lint-is: good" <<< $commit
+ then
+ exit 0
+ fi
+ if grep -q "Test-is: good" <<< $commit
then
exit 0
fi