File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ <h1><a href="/">githook.sh</a> docs</h1>
2020< div >
2121< b > integration:</ b >
2222< a href ="#ci "> ci/cd</ a > ·
23- < a href ="#npm "> npm</ a > ·
23+ < a href ="#package-json "> package.json</ a > ·
24+ < a href ="#makefile "> makefile</ a > ·
2425< a href ="#husky "> husky</ a > ·
2526< a href ="#languages "> languages</ a >
2627</ div >
@@ -98,14 +99,21 @@ <h2 id="ci">ci/cd and docker</h2>
9899# docker
99100ENV GITHOOK=0</ pre >
100101
101- < h2 id ="npm "> package.json integration</ h2 >
102+ < h2 id ="package-json "> package.json integration</ h2 >
102103< p > auto-install hooks when developers run < code > npm install</ code > :</ p >
103104< p > < strong > npm / pnpm / bun:</ strong > </ p >
104105< pre > npm pkg set scripts.prepare="./.githook.sh install"</ pre >
105106< p > < strong > yarn:</ strong > </ p >
106107< pre > npm pkg set scripts.postinstall="./.githook.sh install"</ pre >
107108< p > yarn uses < code > postinstall</ code > instead of < code > prepare</ code > .</ p >
108109
110+ < h2 id ="makefile "> makefile integration</ h2 >
111+ < p > add a target for installing hooks:</ p >
112+ < pre > .PHONY: prepare
113+ prepare:
114+ ./.githook.sh install</ pre >
115+ < p > run < code > make prepare</ code > after cloning.</ p >
116+
109117< h2 id ="husky "> migrating from husky</ h2 >
110118< p > hooks are automatically migrated during setup if < code > .husky/</ code > exists. to migrate manually:</ p >
111119< pre > ./.githook.sh migrate husky</ pre >
You can’t perform that action at this time.
0 commit comments