Skip to content
This repository was archived by the owner on Jan 8, 2024. It is now read-only.

Commit cd31b4b

Browse files
committed
create Makefile from dataworks-github-config/Makefile.sample
1 parent d5a4428 commit cd31b4b

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
SHELL:=bash
2+
3+
default: help
4+
5+
.PHONY: help
6+
help:
7+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
8+
9+
.PHONY: bootstrap
10+
bootstrap: ## Bootstrap local environment for first use
11+
make git-hooks
12+
13+
.PHONY: git-hooks
14+
git-hooks: ## Set up hooks in .git/hooks
15+
@{ \
16+
HOOK_DIR=.git/hooks; \
17+
for hook in $(shell ls .githooks); do \
18+
if [ ! -h $${HOOK_DIR}/$${hook} -a -x $${HOOK_DIR}/$${hook} ]; then \
19+
mv $${HOOK_DIR}/$${hook} $${HOOK_DIR}/$${hook}.local; \
20+
echo "moved existing $${hook} to $${hook}.local"; \
21+
fi; \
22+
ln -s -f ../../.githooks/$${hook} $${HOOK_DIR}/$${hook}; \
23+
done \
24+
}

0 commit comments

Comments
 (0)