mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-08-06 17:36:53 +01:00
Resolve knowledge-index root to absolute path (cross-platform fix)
Get-ChildItem.FullName is always absolute, so deriving the relative article path via Substring(\.Length) requires an absolute root. A relative root such as '.' (used by the CI guard's 'Test-KnowledgeIndex.ps1 -Root .') left the full path almost intact on Linux, producing bogus 'home/runner/.../knowledge' paths and failing the coverage check. Normalise both the generator's -BCQualityRoot and the test's -Root with Resolve-Path before use. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
eb462ee1f9
commit
95e84418ed
2 changed files with 8 additions and 0 deletions
|
|
@ -79,6 +79,10 @@ if (-not $BCQualityRoot) {
|
|||
if (-not (Test-Path $BCQualityRoot)) {
|
||||
throw "BCQuality root not found: $BCQualityRoot"
|
||||
}
|
||||
# Normalise to an absolute path: Get-ChildItem.FullName below is always
|
||||
# absolute, so Get-RelativePath's Substring needs an absolute root to strip.
|
||||
# A relative root (e.g. '.') would otherwise leave the full path intact.
|
||||
$BCQualityRoot = (Resolve-Path -LiteralPath $BCQualityRoot).Path
|
||||
if (-not $IndexPath) {
|
||||
$IndexPath = Join-Path $BCQualityRoot 'knowledge-index.json'
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue