gra0007_obsidian-css-inlay-.../version-bump.mjs

15 lines
656 B
JavaScript
Raw Permalink Normal View History

2024-07-19 02:41:29 +00:00
import { readFileSync, writeFileSync } from 'node:fs'
2024-07-18 05:51:26 +00:00
2024-07-19 02:41:29 +00:00
const targetVersion = process.env.npm_package_version
2024-07-18 05:51:26 +00:00
// read minAppVersion from manifest.json and bump version to target version
2024-07-19 02:41:29 +00:00
const manifest = JSON.parse(readFileSync('manifest.json', 'utf8'))
const { minAppVersion } = manifest
manifest.version = targetVersion
2024-07-19 03:39:46 +00:00
writeFileSync('manifest.json', `${JSON.stringify(manifest, null, 2)}\n`)
2024-07-18 05:51:26 +00:00
// update versions.json with target version and minAppVersion from manifest.json
2024-07-19 02:41:29 +00:00
const versions = JSON.parse(readFileSync('versions.json', 'utf8'))
versions[targetVersion] = minAppVersion
2024-07-19 03:39:46 +00:00
writeFileSync('versions.json', `${JSON.stringify(versions, null, 2)}\n`)