PagerMaid-Pyro/.github/get_version.py
xtaodada 895ca3ca9d
All checks were successful
Docker Dev Build / docker build and publish (push) Successful in 6m56s
Docker Build / docker build and publish (push) Successful in 16m34s
👷 CI: support gitea
2024-07-08 14:05:28 +08:00

13 lines
296 B
Python

import re
def get_version():
with open("pagermaid/__init__.py", "r", encoding="utf-8") as f:
if version_match := re.search(r'pgm_version = "(.*?)"', f.read()):
return version_match[1]
raise FileNotFoundError
if __name__ == "__main__":
print(get_version())