remove "## " from changelog.md version

This commit is contained in:
AUTOMATIC1111 2023-07-15 09:33:21 +03:00
parent 0aa8d538e1
commit c58cf73c80

View File

@ -69,10 +69,12 @@ def git_tag():
return subprocess.check_output([git, "describe", "--tags"], shell=False, encoding='utf8').strip() return subprocess.check_output([git, "describe", "--tags"], shell=False, encoding='utf8').strip()
except Exception: except Exception:
try: try:
from pathlib import Path
changelog_md = Path(__file__).parent.parent / "CHANGELOG.md" changelog_md = os.path.join(os.path.dirname(os.path.dirname(__file__)), "CHANGELOG.md")
with changelog_md.open(encoding="utf-8") as file: with open(changelog_md, "r", encoding="utf-8") as file:
return next((line.strip() for line in file if line.strip()), "<none>") line = next((line.strip() for line in file if line.strip()), "<none>")
line = line.replace("## ", "")
return line
except Exception: except Exception:
return "<none>" return "<none>"