- Add .githooks directory with pre-commit hook for cv.webp generation - Create installation script for hooks setup - Add documentation for hooks usage - Refactor timeline arrows into reusable commands (\timelinearrow and \timelinearrowcontinue) - Simplify arrow usage by only requiring length parameter
31 lines
845 B
Bash
Executable File
31 lines
845 B
Bash
Executable File
#!/bin/bash
|
|
# Install git hooks from .githooks directory
|
|
|
|
HOOKS_DIR=".githooks"
|
|
GIT_HOOKS_DIR=".git/hooks"
|
|
|
|
# Ensure .git/hooks directory exists
|
|
if [ ! -d "$GIT_HOOKS_DIR" ]; then
|
|
echo "Error: .git/hooks directory not found. Are you in a git repository?"
|
|
exit 1
|
|
fi
|
|
|
|
# Copy all hooks from .githooks to .git/hooks
|
|
for hook in "$HOOKS_DIR"/*; do
|
|
# Skip this installation script
|
|
if [ "$(basename "$hook")" = "install-hooks.sh" ] || [ "$(basename "$hook")" = "README.md" ]; then
|
|
continue
|
|
fi
|
|
|
|
if [ -f "$hook" ]; then
|
|
hook_name=$(basename "$hook")
|
|
echo "Installing $hook_name..."
|
|
cp "$hook" "$GIT_HOOKS_DIR/$hook_name"
|
|
chmod +x "$GIT_HOOKS_DIR/$hook_name"
|
|
echo "✓ $hook_name installed"
|
|
fi
|
|
done
|
|
|
|
echo ""
|
|
echo "All hooks installed successfully!"
|