2026-08-06 16:09:41 +02:00
|
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
|
|
|
|
|
|
$repositoryRoot = (& git -C $PSScriptRoot rev-parse --show-toplevel).Trim()
|
|
|
|
|
if ($LASTEXITCODE -ne 0 -or [string]::IsNullOrWhiteSpace($repositoryRoot)) {
|
|
|
|
|
throw 'Could not locate the shared Git repository.'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
& git -C $repositoryRoot config core.hooksPath .githooks
|
|
|
|
|
if ($LASTEXITCODE -ne 0) {
|
|
|
|
|
throw 'Could not configure the shared Git hooks path.'
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-19 21:14:31 +00:00
|
|
|
Write-Host "Installed shared post-commit synchronization hook in $repositoryRoot. It runs only for commits made with SHARED_SYNC_COMMIT=1."
|