mirror of
https://github.com/tw93/Mole.git
synced 2026-02-04 22:04:43 +00:00
feat: Add git hooks to enforce universal binary builds and improve CPU metric calculation.
This commit is contained in:
28
scripts/setup-hooks.sh
Executable file
28
scripts/setup-hooks.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
# Install git hooks for Mole development
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
HOOKS_DIR="$REPO_ROOT/.git/hooks"
|
||||
|
||||
if [[ ! -d "$REPO_ROOT/.git" ]]; then
|
||||
echo "Error: Not in a git repository"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Installing git hooks..."
|
||||
|
||||
# Install pre-commit hook
|
||||
if [[ -f "$SCRIPT_DIR/hooks/pre-commit" ]]; then
|
||||
cp "$SCRIPT_DIR/hooks/pre-commit" "$HOOKS_DIR/pre-commit"
|
||||
chmod +x "$HOOKS_DIR/pre-commit"
|
||||
echo "✓ Installed pre-commit hook (validates universal binaries)"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Git hooks installed successfully!"
|
||||
echo ""
|
||||
echo "The pre-commit hook will ensure that bin/analyze-go and bin/status-go"
|
||||
echo "are universal binaries (x86_64 + arm64) before allowing commits."
|
||||
Reference in New Issue
Block a user