Skip to content

Commit

Permalink
fix: fix meson version getter
Browse files Browse the repository at this point in the history
  • Loading branch information
Totto16 authored and tristan957 committed Dec 12, 2024
1 parent 29d5311 commit 9a40eac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/introspection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ export async function getMesonBenchmarks(buildDir: string) {
}

export async function getMesonVersion(): Promise<[number, number, number]> {
const MESON_VERSION_REGEX = /^(\d+)\.(\d+)\.(\d+)/g;
const MESON_VERSION_REGEX = /^(\d+)\.(\d+)\.(\d+)/;

const { stdout } = await exec(extensionConfiguration("mesonPath"), ["--version"]);
const match = stdout.trim().match(MESON_VERSION_REGEX);
if (match) {
return match.slice(1, 3).map((s) => Number.parseInt(s)) as [number, number, number];
if (match && match.length >= 4) {
return match.slice(1, 4).map((s) => Number.parseInt(s)) as [number, number, number];
} else throw new Error("Meson version doesn't match expected output: " + stdout.trim());
}

0 comments on commit 9a40eac

Please sign in to comment.