15 lines
423 B
Bash
Executable File
15 lines
423 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -eu
|
|
# Install repository-local git hooks by setting core.hooksPath
|
|
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
HOOKS_DIR="$REPO_ROOT/.githooks"
|
|
|
|
if [ ! -d "$HOOKS_DIR" ]; then
|
|
echo "No .githooks directory found in repo root: $HOOKS_DIR"
|
|
exit 1
|
|
fi
|
|
|
|
git config core.hooksPath "$HOOKS_DIR"
|
|
echo "Installed git hooks path: $HOOKS_DIR"
|
|
echo "You can revert with: git config --unset core.hooksPath"
|