chiark
/
gitweb
/
~ianmdlvl
/
fdroidserver.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d3faacf
)
Properly catch return codes since -x is no longer used
author
Daniel Martí
<mvdan@mvdan.cc>
Sun, 9 Nov 2014 13:36:58 +0000
(14:36 +0100)
committer
Daniel Martí
<mvdan@mvdan.cc>
Sun, 9 Nov 2014 13:36:58 +0000
(14:36 +0100)
hooks/pre-commit
patch
|
blob
|
history
diff --git
a/hooks/pre-commit
b/hooks/pre-commit
index 9abcc0a2f34319ef3d4be2c1a808381dc1a66036..e4457023e35d24ce4482db1d9aa120aeb236ae86 100755
(executable)
--- a/
hooks/pre-commit
+++ b/
hooks/pre-commit
@@
-37,20
+37,22
@@
else
fi
# If there are python errors or warnings, print them and fail.
fi
# If there are python errors or warnings, print them and fail.
-$PYFLAKES $PY_FILES
-$PEP8 --ignore=E123,E501 $PY_FILES
+
+if ! $PYFLAKES $PY_FILES; then
+ err "pyflakes tests failed!"
+fi
+
+if ! $PEP8 --ignore=E123,E501 $PY_FILES; then
+ err "pep8 tests failed!"
+fi
-#------------------------------------------------------------------------------#
-# check the syntax of included shell scripts
+# check the syntax of included shell scripts with bash -n
-# use bash to check that the syntax is correct
for f in $SH_FILES; do
for f in $SH_FILES; do
- if bash -n $f; then
- : # success! do nothing
- else
- err "FAILED!"
- fi
+ if ! bash -n $f; then
+ err "bash tests failed!"
+ fi
done
exit 0
done
exit 0