From c887f84a05ddb462caa8be54e54e270a8fd5cf1d Mon Sep 17 00:00:00 2001 From: Jeff Bradberry Date: Tue, 18 May 2021 13:20:55 -0400 Subject: [PATCH] Add a check for the existence of pre-commit.sh so that you don't get stuck when working on branches that don't have this yet. --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2b7b20afb2..3e5f511bc4 100644 --- a/Makefile +++ b/Makefile @@ -272,7 +272,9 @@ black: reports @(set -o pipefail && $@ $(BLACK_ARGS) awx awxkit awx_collection | tee reports/$@.report) .git/hooks/pre-commit: - @echo "./pre-commit.sh" > .git/hooks/pre-commit + @echo "if [ -x pre-commit.sh ]; then" > .git/hooks/pre-commit + @echo " ./pre-commit.sh;" >> .git/hooks/pre-commit + @echo "fi" >> .git/hooks/pre-commit @chmod +x .git/hooks/pre-commit genschema: reports