Feature: block commits of boboko-core local-mode wiring

bin/check-core-mode runs as a pre-commit hook and refuses staged
composer.json, package.json or lockfiles that point at ../boboko-core,
which would break the build for everyone. bin/core-mode enables it via
core.hooksPath on first use, since git doesn't version hooks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
lexxandClaude Opus 5.5 committed 2026-11-06 15:57:38 +02:00
1 parent d5dc3290cf
commit 5ea33a0857
3 files changed
+63

No files matched your search

+12
View File
@@ -106,6 +106,18 @@ if [ "$target" = local ] && [ ! -d ../boboko-core ]; then
fail "../boboko-core not found — local mode needs the core checkout next to this repo."
fi
# Turn on the pre-commit guard (bin/check-core-mode) that stops local-mode
# wiring from being committed. Git doesn't version hooks, so it's enabled here,
# the first time anyone switches modes. Leaves a custom hooksPath alone.
hooks_path=$(git config --get core.hooksPath || true)
if [ -z "$hooks_path" ]; then
git config core.hooksPath .githooks
echo ">>> Enabled the pre-commit guard (git config core.hooksPath .githooks)"
elif [ "$hooks_path" != .githooks ]; then
echo "!!! core.hooksPath is '$hooks_path', so the pre-commit guard isn't active." >&2
echo " Call bin/check-core-mode from your own pre-commit hook." >&2
fi
old_dc=$(wrapper_for "$mode")
new_dc=$(wrapper_for "$target")