poly
Search…
Git hook
We can ensure that we don't push code that puts the workspace in an invalid state, by adding a git hook to our workspace, that executes the check command.
To make this work, all developers should add .git/hooks/commit-msg to the root of the workspace on their local disk with the following content, e.g.:
1
#!/usr/bin/env bash
2
3
exec /usr/bin/java -jar /usr/local/polylith/poly.jar check color-mode:none ws-dir:PATH-TO-WORKSPACE-DIRECTORY
4
5
if [[ $? -ne 0 ]] ; then
6
exit 1
7
fi
Copied!
Replace PATH-TO-WORKSPACE-DIRECTORY with the path to the workspace root.
Last modified 2mo ago
Copy link