13 lines
600 B
JavaScript
13 lines
600 B
JavaScript
import { readFile } from "node:fs/promises";
|
|
|
|
const tag = process.argv[2];
|
|
if (!tag?.startsWith("v")) throw new Error("Release tag must have the form v<version>");
|
|
const packageJson = JSON.parse(await readFile(new URL("../package.json", import.meta.url), "utf8"));
|
|
const manifest = JSON.parse(await readFile(new URL("../install-manifest.json", import.meta.url), "utf8"));
|
|
const expected = tag.slice(1);
|
|
if (packageJson.version !== expected || manifest.version !== expected) {
|
|
throw new Error(
|
|
`Version mismatch: tag=${tag}, package=${packageJson.version}, manifest=${manifest.version}`,
|
|
);
|
|
}
|