0ad-community-mod-a26/scripts/get_version.py
Stanislas Daniel Claude Dolcini f99ad88998
All checks were successful
CI Pipeline / Check Templates (PR) (push) Has been skipped
pre-commit / build (push) Successful in 51s
CI Pipeline / Package and Sign Mod (push) Has been skipped
CI Pipeline / Check Templates (All) (push) Successful in 1m23s
🚨 Fix most ruff warnings
2024-09-11 15:26:41 +03:00

17 lines
306 B
Python

import json
from . import MOD_PATH, check_cwd_is_correct
def get_version():
with open(MOD_PATH / "mod.json") as f:
mod = json.load(f)
print(mod["version"])
if __name__ == "__main__":
check_cwd_is_correct()
get_version()
else:
raise Exception("Must be called directly")