19 lines
479 B
Batchfile
19 lines
479 B
Batchfile
@echo off
|
|
REM Install repository Git hooks (Windows)
|
|
|
|
for /f "delims=" %%i in ('git rev-parse --show-toplevel') do set REPO_ROOT=%%i
|
|
cd /d "%REPO_ROOT%"
|
|
|
|
git config --local core.hooksPath .githooks
|
|
|
|
set CONFIGURED=
|
|
for /f "delims=" %%i in ('git config --local --get core.hooksPath') do set CONFIGURED=%%i
|
|
|
|
if not "%CONFIGURED%"==".githooks" (
|
|
echo Failed to configure repository Git hooks.
|
|
exit /b 1
|
|
)
|
|
|
|
echo Repository hooks installed: core.hooksPath=.githooks
|
|
exit /b 0
|