From 5d647f26ded26537401050851d189d06b3f4ce4e Mon Sep 17 00:00:00 2001 From: Research Assistant Date: Thu, 30 Apr 2026 12:56:28 +0800 Subject: [PATCH] chore: add version sync script (__init__.py -> manifest.json) --- scripts/sync-plugin-version.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 scripts/sync-plugin-version.py diff --git a/scripts/sync-plugin-version.py b/scripts/sync-plugin-version.py new file mode 100644 index 00000000..f1c6dbd6 --- /dev/null +++ b/scripts/sync-plugin-version.py @@ -0,0 +1,13 @@ +"""Sync plugin manifest.json version from paperforge.__version__.""" +import json +from pathlib import Path +from paperforge import __version__ + +manifest_path = Path(__file__).resolve().parent.parent / "paperforge" / "plugin" / "manifest.json" +manifest = json.loads(manifest_path.read_text(encoding="utf-8")) +if manifest["version"] != __version__: + manifest["version"] = __version__ + manifest_path.write_text(json.dumps(manifest, indent=2, ensure_ascii=False) + "\n", encoding="utf-8") + print(f"manifest.json: {manifest['version']} -> {__version__}") +else: + print(f"manifest.json in sync (v{__version__})")