mirror of
https://github.com/munckenh/obsidian-relative-dates.git
synced 2026-07-22 06:43:16 +00:00
16 lines
No EOL
715 B
JavaScript
16 lines
No EOL
715 B
JavaScript
import { readFileSync, writeFileSync } from 'fs';
|
|
|
|
const targetVersion = process.env.npm_package_version;
|
|
|
|
// Read minAppVersion from manifest.json and bump version to target version
|
|
let manifest = JSON.parse(readFileSync('manifest.json', 'utf8'));
|
|
const { minAppVersion } = manifest;
|
|
manifest.version = targetVersion;
|
|
writeFileSync('manifest.json', JSON.stringify(manifest, null, '\t'));
|
|
|
|
// Update versions.json with target version and minAppVersion from manifest.json
|
|
const versions = JSON.parse(readFileSync('versions.json', 'utf8'));
|
|
if (!Object.values(versions).includes(minAppVersion)) {
|
|
versions[targetVersion] = minAppVersion;
|
|
writeFileSync('versions.json', JSON.stringify(versions, null, '\t'));
|
|
} |