polserver/hook_helper.bat
frozenblit 5a97b8d3aa Added versioned git hooks support. (Windows)
The script "install_git_hooks_WIN.vbs" will request admin
privileges and create a symbolic link to "git_hooks" in the ".git/hooks"
folder. Git hooks can be added to the repository in the folder "git_hooks".
2014-08-25 01:21:57 +02:00

30 lines
692 B
Batchfile

@echo off
rem
rem This scripts creates a symbolic link to git_hooks (under version control) from
rem the folder ".git/hooks"
rem
rem It requires admin privileges because of "mklink". If you don't have them, copy
rem all files manually.
rem
rem
if exist ".git/hooks" (goto needToDelete) else goto install
:needToDelete
choice /M "Folder already exists. Continue?"
if errorlevel 2 goto fail
rmdir /S ".git\hooks"
:install
echo Creating the symbolic link...
mklink /D ".git\hooks" "..\git_hooks"
if errorlevel 1 (goto fail) else (goto end)
:fail
echo Hook installation failed. Make sure you run this batch with admin privileges and that the folder doesnt exist.
:end
echo Done.
pause