generated from obsidianmd/obsidian-sample-plugin
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update version bump script. Clean up versions.json
- Loading branch information
1 parent
a0cd9e6
commit c3d2e61
Showing
2 changed files
with
11 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
import { readFileSync, writeFileSync } from "fs"; | ||
#!/usr/bin/env node | ||
|
||
const targetVersion = process.env.npm_package_version; | ||
import { readFileSync, writeFileSync } from 'fs'; | ||
|
||
// 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")); | ||
let targetVersion = process.argv[2]; | ||
|
||
let packageJson = JSON.parse(readFileSync('package.json', 'utf8')); | ||
packageJson.version = targetVersion; | ||
writeFileSync('package.json', JSON.stringify(packageJson, null, '\t')); | ||
|
||
// update versions.json with target version and minAppVersion from manifest.json | ||
let versions = JSON.parse(readFileSync("versions.json", "utf8")); | ||
versions[targetVersion] = minAppVersion; | ||
writeFileSync("versions.json", JSON.stringify(versions, null, "\t")); | ||
let manifest = JSON.parse(readFileSync('manifest.json', 'utf8')); | ||
manifest.version = targetVersion; | ||
writeFileSync('manifest.json', JSON.stringify(manifest, null, '\t')); |