mirror of
https://github.com/uutils/shadow.git
synced 2026-06-10 16:14:57 -07:00
202acc16c9
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/
29 lines
702 B
Bash
Executable File
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"
|