dralkh_spaceforge/version-bump.mjs

21 lines
814 B
JavaScript
Raw Permalink Normal View History

2025-07-31 04:03:20 +00:00
import { readFileSync, writeFileSync } from "fs";
const targetVersion = process.argv[2];
const minAppVersion = process.argv[3];
// Read minAppVersion from existing manifest.json if not provided
let manifest = JSON.parse(readFileSync("manifest.json", "utf8"));
const { minAppVersion: currentMinAppVersion } = manifest;
// Write updated manifest.json
manifest.version = targetVersion;
manifest.minAppVersion = minAppVersion ?? currentMinAppVersion;
writeFileSync("manifest.json", JSON.stringify(manifest, null, 2));
// Update versions.json with the new version
let versions = JSON.parse(readFileSync("versions.json", "utf8"));
versions[targetVersion] = minAppVersion ?? currentMinAppVersion;
writeFileSync("versions.json", JSON.stringify(versions, null, 2));
console.log(`Updated to version ${targetVersion}`);