Skip to content

Commit

Permalink
Adding file check over make commands added
Browse files Browse the repository at this point in the history
  • Loading branch information
David Ferlay committed Apr 8, 2019
1 parent fa0f68c commit 802ec68
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 802ec68

Please sign in to comment.