mirror of
https://github.com/lllin000/PaperForge.git
synced 2026-07-22 06:50:53 +00:00
chore: add version sync script (__init__.py -> manifest.json)
This commit is contained in:
parent
00914d69fc
commit
5d647f26de
1 changed files with 13 additions and 0 deletions
13
scripts/sync-plugin-version.py
Normal file
13
scripts/sync-plugin-version.py
Normal file
|
|
@ -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__})")
|
||||
Loading…
Reference in a new issue