Last active
November 10, 2022 19:56
-
-
Save djhunter67/d7b87f42d13bbfdd44ed5e767f1184ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ROOT = pathlib.Path(__file__).resolve().parent.parent.parent | |
WORKING = ROOT / "src" / "gui" | |
def version_getter() -> str | None: | |
"""Get the latest version from the CHANGELOG file""" | |
with open(ROOT / "CHANGELOG.md", "r") as f: | |
for line in f: | |
if line.__contains__("##") and not line.__contains__("YEAR MONTH DAY"): | |
correct_line = line.split("-")[0].strip() | |
version = correct_line.split("[")[1] | |
return version.strip("]") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This will get the version from the specific file type I use for changelogs.