From 20fcb9ea5bd55307b2c96879f4f0cac540cc6fd0 Mon Sep 17 00:00:00 2001 From: Julian Lechner Date: Mon, 16 Nov 2026 12:20:07 +0100 Subject: [PATCH] fix(plugins): detect extensionless npm global CLIs on Unix Test-CliCommand cast the matching suffix to bool. On Unix the only match is the empty suffix '', which [bool] treats as false, so CLIs such as MCPorter in the npm global prefix were never detected. Count matches instead. Co-Authored-By: Claude Opus 5.5 --- scripts/lib/plugins.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 {