Mercurial > obsidian-remember-file-state
comparison version-bump.mjs @ 19:2a9e941c96ee
Bring new build tools from the sample plugin project
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Fri, 18 Mar 2022 19:19:18 -0700 |
parents | |
children | 712761e7625b |
comparison
equal
deleted
inserted
replaced
18:131ae934ea07 | 19:2a9e941c96ee |
---|---|
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")); | |
15 |