#!/bin/bash # # BASIC pre-commit hook for Folder DateTime Fix (VERSION ONLY) # # ⚠️ WARNING: This hook provides NO SECURITY PROTECTION! # # Features: # - Updates __version__ string in folder_datetime_fix/version.py # - Format: VERSION_BRANCH_BUILD-YYYYMMDD-COMMITHASH # # Missing: # - NO branch protection # - NO private file detection # - NO file size limits # - NO debug statement checks # # For production use, install the standard pre-commit hook instead # set -e # Find the repository root (where .git is located) REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)" # Path to update script UPDATE_SCRIPT="$REPO_ROOT/scripts/update-version.sh" # Call the centralized version update script in auto mode if [ -f "$UPDATE_SCRIPT" ]; then "$UPDATE_SCRIPT" --auto else echo "[Version Hook] Warning: update-version.sh not found" echo "[Version Hook] Version will not be updated" # Don't fail the commit - just warn fi # Success - allow commit exit 0