obsidian-semantic

Log | Files | Refs | README

version-bump.mjs (648B)


      1 import { readFileSync, writeFileSync } from "fs";
      2 
      3 const targetVersion = process.env.npm_package_version;
      4 
      5 // read minAppVersion from manifest.json and bump version to target version
      6 let manifest = JSON.parse(readFileSync("manifest.json", "utf8"));
      7 const { minAppVersion } = manifest;
      8 manifest.version = targetVersion;
      9 writeFileSync("manifest.json", JSON.stringify(manifest, null, "\t"));
     10 
     11 // update versions.json with target version and minAppVersion from manifest.json
     12 let versions = JSON.parse(readFileSync("versions.json", "utf8"));
     13 versions[targetVersion] = minAppVersion;
     14 writeFileSync("versions.json", JSON.stringify(versions, null, "\t"));