From 6e37d3a37e28537288a056184bf98446a8cf38dd Mon Sep 17 00:00:00 2001 From: Adam Wright Date: Tue, 12 Jan 2016 23:32:33 -0800 Subject: [PATCH] Fix pre-push/commit hooks so they work. - Move them back to the root directory of the repo - Explicitly specify the path to the manifest we are running tests for --- {tarpc/hooks => hooks}/pre-commit | 0 {tarpc/hooks => hooks}/pre-push | 10 ++++++---- 2 files changed, 6 insertions(+), 4 deletions(-) rename {tarpc/hooks => hooks}/pre-commit (100%) rename {tarpc/hooks => hooks}/pre-push (72%) diff --git a/tarpc/hooks/pre-commit b/hooks/pre-commit similarity index 100% rename from tarpc/hooks/pre-commit rename to hooks/pre-commit diff --git a/tarpc/hooks/pre-push b/hooks/pre-push similarity index 72% rename from tarpc/hooks/pre-push rename to hooks/pre-push index 52fd8f3..c5c21e7 100755 --- a/tarpc/hooks/pre-push +++ b/hooks/pre-push @@ -7,12 +7,12 @@ NC='\033[0m' # No Color git diff --exit-code &>/dev/null if [ "$?" != 0 ]; then - echo ${RED}ERROR${NC} You have uncommitted changes please commit or stash them before pushing. + echo ${RED}ERROR${NC} You have uncommitted changes please commit or stash them before pushing so that I can run tests! exit 1 fi TEST_RESULT=0 -cargo test &>/dev/null +cargo test --manifest-path tarpc/Cargo.toml &>/dev/null if [ "$?" != "0" ]; then echo ${RED}FAIL${NC} pre-push test check @@ -21,8 +21,10 @@ else echo ${GREEN}PASS${NC} pre-push test check fi +RESULT=0 if [ "$TEST_RESULT" == "1" ]; then - exit 1 + RESULT=1 fi -exit 0 + +exit $RESULT