Add tracked Git hooks and refactor timeline arrows

- 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
This commit is contained in:
2025-10-27 12:58:04 +01:00
parent 091aeb4798
commit 9cec37d7ea
3 changed files with 109 additions and 0 deletions

30
.githooks/install-hooks.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/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!"