0
0
Fork 0

Change to a Python file for version bumping

This commit is contained in:
Oliver Akins 2022-05-27 00:41:43 -06:00
parent 45927a5dcb
commit 1f9f9f88bb
No known key found for this signature in database
GPG key ID: 3C2014AF9457AF99
2 changed files with 30 additions and 14 deletions

30
version-bump.py Normal file
View file

@ -0,0 +1,30 @@
import json
plugin_version = None
obsidian_version = None
# Load the versions from the manifest
with open("manifest.json", "r") as file:
data = json.load(file)
obsidian_version = data["minAppVersion"]
plugin_version = data["version"]
# Update the package.json
with open("package.json", "r") as file:
package = json.load(file)
if plugin_version:
package["version"] = plugin_version
with open("versions.json", "r") as file:
versions = json.load(file)
if plugin_version and obsidian_version:
versions[plugin_version] = obsidian_version
with open("package.json", "w") as file:
json.dump(package, file, indent=2)
with open("versions.json", "w") as file:
json.dump(versions, file, indent=2)