Skip to content

Commit 173fe6c

Browse files
authored
Merge pull request #80 from devmgn/fix/version-comparison
fix: use SemVer for pkgx version comparison
2 parents 4a1f44d + 1bdcb3a commit 173fe6c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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)