Skip to content

Commit

Permalink
Merge pull request clearcontainers#952 from jodh-intel/improve-git-ho…
Browse files Browse the repository at this point in the history
…ok-install-check

build: Check ".git" is a directory before hook install
  • Loading branch information
Samuel Ortiz authored Jan 24, 2018
2 parents af73dec + c533374 commit 322bcb6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,13 @@ QUIET_GENERATE = $(Q:@=@echo ' GENERATE '$@;)
QUIET_INST = $(Q:@=@echo ' INSTALL '$@;)
QUIET_TEST = $(Q:@=@echo ' TEST '$@;)

# return non-empty string if file exists
define FILE_EXISTS
$(realpath $1)
# Return non-empty string if specified directory exists
define DIR_EXISTS
$(shell test -d $(1) && echo "$(1)")
endef

# only install git hooks if working in a git clone
ifneq (,$(call FILE_EXISTS,.git))
# Only install git hooks if working in a git clone
ifneq (,$(call DIR_EXISTS,.git))
HANDLE_GIT_HOOKS = install-git-hooks
endif

Expand Down

0 comments on commit 322bcb6

Please sign in to comment.