DavidKalina / Commit-Chronicles-Script

0 stars 0 forks source link

Automatically configure / Minimize configuration of git hooks #9

Open DavidKalina opened 6 months ago

DavidKalina commented 6 months ago
#!/bin/sh
# setupHooks.sh

# Navigate to the .git/hooks directory
cd .git/hooks

# Write the post-commit hook script
cat << 'EOF' > post-commit
#!/bin/sh
# Adjust the path to where your project stores the commitScript.ts
REPO_ROOT=$(git rev-parse --show-toplevel)
bun $REPO_ROOT/scripts/commitScript.ts
EOF

# Make the hook executable
chmod +x post-commit