Skip to content

Commit 7661406

Browse files
Create hooks.md
1 parent 18b3f2b commit 7661406

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

recipes/jekyll/hooks.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Hooks
2+
3+
- `Makefile`
4+
```mk
5+
.PHONY: hooks
6+
hooks:
7+
# Don't use -r flag as it is not widely compatible.
8+
cd .git/hooks && ln -s -f ../../hooks/pre-push pre-push
9+
ls -l ./.git/hooks/pre-push
10+
```
11+
- `hooks/pre-push`
12+
```sh
13+
#!/bin/sh -e
14+
15+
git pull --rebase
16+
17+
# Prevent push on failed Jekyll build.
18+
make build
19+
```

0 commit comments

Comments
 (0)