fix: support pre-release versions in build script

This commit is contained in:
callumalpass 2025-10-29 23:29:05 +11:00
parent a049c827a6
commit 56c851c5a4

View file

@ -5,9 +5,9 @@ import { execSync } from "child_process";
const manifest = JSON.parse(readFileSync("manifest.json", "utf8"));
const currentVersion = manifest.version;
// Parse semantic version
// Parse semantic version (supports pre-release versions like 4.0.0-beta.0)
function parseVersion(version) {
const match = version.match(/^(\d+)\.(\d+)\.(\d+)$/);
const match = version.match(/^(\d+)\.(\d+)\.(\d+)(?:-[\w.]+)?$/);
if (!match) return null;
return {
major: parseInt(match[1]),