fix(wrapper): correct PowerShell path trimming

This commit is contained in:
AkitaOnRails
2026-08-07 10:59:58 -03:00
parent 55af6d1473
commit 968357fd8e
3 changed files with 20 additions and 3 deletions
+2 -2
View File
@@ -44,7 +44,7 @@ $HomePath = (Resolve-Path -LiteralPath $HOME).Path
$WorkPath = (Get-Location).Path
$HookHostRoot = ($HomePath -replace '\\', '/') + "/.local/share/ai-memory/hooks"
$HomeRoot = $HomePath.TrimEnd([char[]]@('/', '\\'))
$HomeRoot = $HomePath.TrimEnd([char[]]@('/', '\'))
$HomePrefix = $HomeRoot + [IO.Path]::DirectorySeparatorChar
$InsideHome = $WorkPath.Equals($HomeRoot, [StringComparison]::OrdinalIgnoreCase) -or
$WorkPath.StartsWith($HomePrefix, [StringComparison]::OrdinalIgnoreCase)
@@ -64,7 +64,7 @@ if ($InsideHome) {
$ScopeRoot = [IO.Path]::GetFullPath($DetectedScopeRoot.Trim())
}
}
$ScopeRoot = $ScopeRoot.TrimEnd([char[]]@('/', '\\'))
$ScopeRoot = $ScopeRoot.TrimEnd([char[]]@('/', '\'))
$ScopePrefix = $ScopeRoot + [IO.Path]::DirectorySeparatorChar
if ($WorkPath.Equals($ScopeRoot, [StringComparison]::OrdinalIgnoreCase)) {
$ScopeSuffix = ""