chrislicodes_obsidian-chess.../version-bump.mjs

15 lines
648 B
JavaScript
Raw Permalink Normal View History

2023-05-17 19:02:43 +00:00
import { readFileSync, writeFileSync } from 'fs';
2023-05-06 11:50:47 +00:00
const targetVersion = process.env.npm_package_version;
// read minAppVersion from manifest.json and bump version to target version
2023-05-17 19:02:43 +00:00
let manifest = JSON.parse(readFileSync('manifest.json', 'utf8'));
2023-05-06 11:50:47 +00:00
const { minAppVersion } = manifest;
manifest.version = targetVersion;
2023-05-17 19:02:43 +00:00
writeFileSync('manifest.json', JSON.stringify(manifest, null, '\t'));
2023-05-06 11:50:47 +00:00
// update versions.json with target version and minAppVersion from manifest.json
2023-05-17 19:02:43 +00:00
let versions = JSON.parse(readFileSync('versions.json', 'utf8'));
2023-05-06 11:50:47 +00:00
versions[targetVersion] = minAppVersion;
2023-05-17 19:02:43 +00:00
writeFileSync('versions.json', JSON.stringify(versions, null, '\t'));