[hooks][fix]: 修正提交检查并同步 UI 文档
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user