nymbo_Copy-Highlighter/version-bump.mjs
2026-05-12 16:22:48 -04:00

16 lines
555 B
JavaScript

import { readFileSync, writeFileSync } from "fs";
const targetVersion = process.env.npm_package_version;
if (!targetVersion) {
throw new Error("No package version found.");
}
const manifest = JSON.parse(readFileSync("manifest.json", "utf8"));
const versions = JSON.parse(readFileSync("versions.json", "utf8"));
manifest.version = targetVersion;
versions[targetVersion] = manifest.minAppVersion;
writeFileSync("manifest.json", `${JSON.stringify(manifest, null, "\t")}\n`);
writeFileSync("versions.json", `${JSON.stringify(versions, null, "\t")}\n`);