-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (38 loc) · 1.23 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Makefile for running common project tasks
# The default target to run when no arguments are given
.PHONY: all
all: help
# Run the test script
.PHONY: test
test:
./test
# Update snapshot by running the update_snapshot.zsh script
.PHONY: update-snapshot
update-snapshot:
./tests/update_snapshot.zsh
# Update the README by running the update_readme_help.zsh script
.PHONY: update-readme
update-readme:
./tools/update_readme_help.zsh $(ARGS)
# Install the pre-commit hook
.PHONY: install-pre-commit
install-pre-commit:
@echo "Installing pre-commit hook..."
@echo "#!/usr/bin/env zsh\nmake test" > .git/hooks/pre-commit
@chmod +x .git/hooks/pre-commit
@echo "Pre-commit hook installed"
# Clean
.PHONY: clean
clean:
rm -f .git/hooks/pre-commit
# Display help
.PHONY: help
help:
@echo "Usage:"
@echo " make test Run the test script"
@echo " make update-snapshot Run the update_snapshot.zsh script"
@echo " make update-readme Run the update_readme_help.zsh script,"
@echo " Use \`ARGS=-u make update-readme\` to"
@echo " also update snapshot."
@echo " make install-pre-commit Install the pre-commit hook"
@echo " make clean Clean"