[hooks][fix]: 修正提交检查并同步 UI 文档

This commit is contained in:
2026-07-21 13:16:45 +08:00
parent 571e299642
commit 4940688687
14 changed files with 35 additions and 33 deletions

View File

@@ -13,8 +13,10 @@ if ([string]::IsNullOrWhiteSpace($RepositoryRoot)) {
$RepositoryRoot = (Get-Location).Path
}
$RepositoryRoot = [System.IO.Path]::GetFullPath($RepositoryRoot)
$gitRoot = & git -C $RepositoryRoot rev-parse --show-toplevel 2>$null | Select-Object -First 1
if ($LASTEXITCODE -ne 0 -or [string]::IsNullOrWhiteSpace($gitRoot)) {
$gitRootOutput = @(& git -C $RepositoryRoot rev-parse --show-toplevel 2>$null)
$gitExitCode = $LASTEXITCODE
$gitRoot = $gitRootOutput | Select-Object -First 1
if ($gitExitCode -ne 0 -or [string]::IsNullOrWhiteSpace($gitRoot)) {
Write-Error "Git repository was not found: $RepositoryRoot"
exit 1
}