From 802ec68554ecc4133071d025cf9dd265da08cd9d Mon Sep 17 00:00:00 2001 From: David Ferlay Date: Mon, 8 Apr 2019 19:37:50 +0200 Subject: [PATCH] Adding file check over make commands added --- Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 04b94e2de..1213d76cc 100644 --- a/Makefile +++ b/Makefile @@ -151,11 +151,19 @@ phpcbf: ## Add symbolic link from custom script(s) to /.git/hooks/pre-commit hooksymlink: +ifneq ("$(wildcard scripts/git_hooks/pre-commit.sh)","") @echo "Installing git hooks" $(shell ln -sf ../../scripts/git_hooks/pre-commit.sh .git/hooks/pre-commit) +else + @echo "scripts/git_hooks/pre-commit.sh file does not exist" +endif + ## Execute git hooks hookexec: +ifneq ("$(wildcard scripts/git_hooks/pre-commit.sh)","") @echo "Executing git hooks" - /bin/sh ./scripts/git_hooks/pre-commit.sh - + @/bin/sh ./scripts/git_hooks/pre-commit.sh +else + @echo "scripts/git_hooks/pre-commit.sh file does not exist" +endif \ No newline at end of file