From 1bdcb3a8deaf2f603bfc7fdedf085a970752a300 Mon Sep 17 00:00:00 2001 From: JUNICHI IMAI <7300018+devmgn@users.noreply.github.com> Date: Sun, 29 Mar 2026 22:55:37 +0900 Subject: [PATCH] fix: use SemVer for pkgx version comparison `parseFloat("2.10")` evaluates to `2.1`, causing pkgm to silently reject pkgx 2.10.x as below the minimum version (2.4). Use the already-imported SemVer class for correct version comparison. Fixes: pkgm install/uninstall/shim silently fail with exit code 1 when pkgx >= 2.10.0 is installed. Co-Authored-By: Claude Opus 4.6 (1M context) --- pkgm.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgm.ts b/pkgm.ts index f128669..7d4ef01 100755 --- a/pkgm.ts +++ b/pkgm.ts @@ -518,8 +518,8 @@ function get_pkgx() { if (existsSync(pkgx)) { const out = new Deno.Command(pkgx, { args: ["--version"] }).outputSync(); const stdout = new TextDecoder().decode(out.stdout); - const match = stdout.match(/^pkgx (\d+.\d+)/); - if (!match || parseFloat(match[1]) < 2.4) { + const match = stdout.match(/^pkgx (\d+\.\d+\.\d+)/); + if (!match || new SemVer(match[1]).lt(new SemVer("2.4.0"))) { Deno.exit(1); } return pkgx;