-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_hooks.bat
More file actions
32 lines (25 loc) · 904 Bytes
/
setup_hooks.bat
File metadata and controls
32 lines (25 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
@echo off
REM Setup Git hooks for automatic documentation updates (Windows)
setlocal enabledelayedexpansion
set "REPO_ROOT=%~dp0"
set "HOOKS_DIR=%REPO_ROOT%.githooks"
set "GIT_HOOKS_DIR=%REPO_ROOT%.git\hooks"
echo 🔧 Setting up Git hooks...
REM Create .git/hooks if it doesn't exist
if not exist "%GIT_HOOKS_DIR%" mkdir "%GIT_HOOKS_DIR%"
REM Copy hooks (without extensions on Windows)
copy "%HOOKS_DIR%\post-commit" "%GIT_HOOKS_DIR%\post-commit" >nul
copy "%HOOKS_DIR%\pre-push" "%GIT_HOOKS_DIR%\pre-push" >nul
REM Configure Git to use custom hooks directory
cd /d "%REPO_ROOT%"
git config core.hooksPath .githooks
echo ✅ Git hooks installed successfully
echo.
echo Hooks configured:
echo - post-commit: Updates documentation after each commit
echo - pre-push: Verifies documentation before pushing
echo.
echo To manually run documentation update:
echo python update_docs.py
echo.
pause