Files
shadow/hooks/install.sh
T
Pierre Warnier 202acc16c9 README: rewrite following uutils format, add local Docker git hooks
README.md: project overview with CVE motivation, goals, tool status
table, Docker build/test/lint instructions, architecture diagram,
test matrix, contributing guidelines with GPL clean-room warning.

hooks/: local CI via Docker (no GitHub Actions, no cloud):
- pre-commit: cargo fmt + clippy on Debian (~5s)
- pre-push: fmt + clippy + tests on Debian/Alpine/Fedora (~30s)
- install.sh: symlinks hooks into .git/hooks/
2026-03-23 13:13:36 +01:00

29 lines
702 B
Bash
Executable File

#!/usr/bin/env bash
# Install shadow-rs git hooks.
#
# Usage: ./hooks/install.sh
#
# This symlinks the hooks into .git/hooks/ so they run automatically
# on commit and push. No GitHub Actions, no cloud — everything local.
set -euo pipefail
REPO_ROOT="$(git rev-parse --show-toplevel)"
HOOKS_DIR="$REPO_ROOT/hooks"
GIT_HOOKS_DIR="$REPO_ROOT/.git/hooks"
for hook in pre-commit pre-push; do
src="$HOOKS_DIR/$hook"
dst="$GIT_HOOKS_DIR/$hook"
if [ -f "$src" ]; then
chmod +x "$src"
ln -sf "$src" "$dst"
echo "installed: $hook -> $dst"
fi
done
echo ""
echo "Git hooks installed. They run in Docker — make sure images are built:"
echo " docker compose build"