Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkgm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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+)/);
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex only captures the numeric major.minor.patch portion, which drops valid SemVer prerelease/build metadata from pkgx --version (eg 2.8.0-beta.1, 2.8.0+abc123). That can misclassify prereleases (eg 2.4.0-beta.1) as 2.4.0 and incorrectly pass the minimum-version gate. Consider capturing the full version token and comparing that full SemVer value instead of truncating it.

Suggested change
const match = stdout.match(/^pkgx (\d+\.\d+\.\d+)/);
const match = stdout.match(/^pkgx ([0-9A-Za-z.+-]+)/);

Copilot uses AI. Check for mistakes.
if (!match || new SemVer(match[1]).lt(new SemVer("2.4.0"))) {
Deno.exit(1);
Comment on lines +522 to 523
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On version parse / minimum-version failure this exits with code 1 without any error output. Since this is a user-facing CLI and version-gating is a common failure mode, please print a clear message (including the detected pkgx --version output and the required minimum) before exiting so users can self-diagnose.

Copilot uses AI. Check for mistakes.
}
return pkgx;
Expand Down
Loading