chore: add bootstrap-siblings post-commit hook
Co-Authored-By: Svrnty Inc. <jp@svrnty.io>
This commit is contained in:
parent
c7d9228a88
commit
41eb5b97cb
15
lefthook.yml
15
lefthook.yml
@ -66,6 +66,21 @@ post-commit:
|
||||
NEW_TOTAL_LINE=$((TOTAL_LINE + 1))
|
||||
sed -i "${NEW_TOTAL_LINE}s/Total: ${OLD_COUNT}/Total: ${NEW_COUNT}/" "$ROOT_CLAUDE"
|
||||
echo "REGISTRY: added '$REPO_NAME' to root CLAUDE.md (${DATE}, ${COMMIT})"
|
||||
bootstrap-siblings:
|
||||
run: |
|
||||
REPO_ROOT=$(git rev-parse --show-toplevel)
|
||||
HOOKS_DIR="$REPO_ROOT/../.svrnty-hooks"
|
||||
[ -f "$HOOKS_DIR/lefthook.yml" ] || exit 0
|
||||
[ -f "$HOOKS_DIR/CLAUDE.md.template" ] || exit 0
|
||||
for sibling in "$REPO_ROOT"/../*/; do
|
||||
[ -d "$sibling/.git" ] || continue
|
||||
[ -f "$sibling/lefthook.yml" ] && continue
|
||||
SNAME=$(basename "$sibling")
|
||||
cp "$HOOKS_DIR/lefthook.yml" "$sibling/lefthook.yml"
|
||||
cp "$HOOKS_DIR/CLAUDE.md.template" "$sibling/CLAUDE.md"
|
||||
(cd "$sibling" && lefthook install 2>/dev/null)
|
||||
echo "BOOTSTRAP: installed lefthook + CLAUDE.md in '$SNAME'"
|
||||
done
|
||||
|
||||
pre-push:
|
||||
commands:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user