mirror of
https://github.com/zoorpha/rustshare-obsidian-plugin.git
synced 2026-07-22 07:48:14 +00:00
chore: add version-bump.mjs and initialize versions.json
Signed-off-by: Zoorpha <aaron@kubedo.com>
This commit is contained in:
parent
dcd6d28936
commit
31925fb32a
2 changed files with 22 additions and 0 deletions
19
version-bump.mjs
Normal file
19
version-bump.mjs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { readFileSync, writeFileSync } from 'fs';
|
||||
|
||||
const targetVersion = process.env.npm_package_version;
|
||||
|
||||
// Read minAppVersion from manifest.json and bump version to target version
|
||||
const manifest = JSON.parse(readFileSync('manifest.json', 'utf8'));
|
||||
const { minAppVersion } = manifest;
|
||||
manifest.version = targetVersion;
|
||||
writeFileSync('manifest.json', JSON.stringify(manifest, null, 2) + '\n');
|
||||
|
||||
// Read versions.json and bump version to target version
|
||||
let versions = {};
|
||||
try {
|
||||
versions = JSON.parse(readFileSync('versions.json', 'utf8'));
|
||||
} catch (e) {
|
||||
// If versions.json doesn't exist, initialize
|
||||
}
|
||||
versions[targetVersion] = minAppVersion;
|
||||
writeFileSync('versions.json', JSON.stringify(versions, null, 2) + '\n');
|
||||
3
versions.json
Normal file
3
versions.json
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"0.1.3": "0.15.0"
|
||||
}
|
||||
Loading…
Reference in a new issue