Error handler now returns a string instead (closes #10)

Commit hook now properly returns status code on failed formatting
This commit is contained in:
Jef Roosens 2021-04-04 15:13:36 +02:00
parent 64161ddcda
commit 6af5368a87
Signed by: Jef Roosens
GPG key ID: B580B976584B5F30
4 changed files with 20 additions and 7 deletions

View file

@ -1,7 +1,10 @@
#!/usr/bin/env bash
# This hook lints the code, and if we're on develop or master, also forces the tests to pass.
cargo fmt -- --check
make lint &> /dev/null 2>&1 || {
>&2 echo "Format check failed, use 'make lint' for more information.";
exit 1;
}
branch=`git rev-parse --abbrev-ref HEAD`