diff --git a/scripts/lib/plugins.ps1 b/scripts/lib/plugins.ps1 index f67024f..46c2b6a 100644 --- a/scripts/lib/plugins.ps1 +++ b/scripts/lib/plugins.ps1 @@ -74,7 +74,8 @@ function Test-CliCommand { $prefix = @(& npm prefix --global 2>$null | ForEach-Object { "$_".Trim() } | Where-Object { $_ }) | Select-Object -Last 1 if (-not $prefix) { return $false } $directory = if ([Environment]::OSVersion.Platform -eq [PlatformID]::Win32NT) { $prefix } else { Join-Path $prefix 'bin' } - return [bool](@('', '.cmd', '.exe', '.ps1') | Where-Object { Test-Path -LiteralPath (Join-Path $directory ($Name + $_)) -PathType Leaf }) + # Count matches: the extensionless Unix match is '', which [bool] would treat as false. + return @(@('', '.cmd', '.exe', '.ps1') | Where-Object { Test-Path -LiteralPath (Join-Path $directory ($Name + $_)) -PathType Leaf }).Count -gt 0 } function Test-InstalledMCPServer {