From a06b583334058f2e254ae85de6bdc581c122267f Mon Sep 17 00:00:00 2001 From: Adam Wright Date: Thu, 18 Feb 2016 01:27:07 -0800 Subject: [PATCH] Also check existence of shasum --- hooks/pre-commit | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/hooks/pre-commit b/hooks/pre-commit index e895800..ae144b9 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -78,6 +78,15 @@ else exit 1 fi +printf "${PREFIX} Checking for shasum ... " +command -v shasum &>/dev/null +if [ $? == 0 ]; then + printf "${SUCCESS}\n" +else + printf "${FAILURE}\n" + exit 1 +fi + # Just check that running rustfmt doesn't do anything to the file. I do this instead of # modifying the file because I don't want to mess with the developer's index, which may # not only contain discrete files. @@ -103,6 +112,4 @@ else printf "${SUCCESS}\n" fi -if [ ${FAILED} != 0 ]; then - exit 1 -fi +exit ${FAILED}