mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
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".
30 lines
692 B
Batchfile
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
|