Skip to content

Commit 1bdcb3a

Browse files
devmgnclaude
andcommitted
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) <noreply@anthropic.com>
1 parent 4a1f44d commit 1bdcb3a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pkgm.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,8 @@ function get_pkgx() {
518518
if (existsSync(pkgx)) {
519519
const out = new Deno.Command(pkgx, { args: ["--version"] }).outputSync();
520520
const stdout = new TextDecoder().decode(out.stdout);
521-
const match = stdout.match(/^pkgx (\d+.\d+)/);
522-
if (!match || parseFloat(match[1]) < 2.4) {
521+
const match = stdout.match(/^pkgx (\d+\.\d+\.\d+)/);
522+
if (!match || new SemVer(match[1]).lt(new SemVer("2.4.0"))) {
523523
Deno.exit(1);
524524
}
525525
return pkgx;

0 commit comments

Comments
 (0)