mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-10-08 14:54:36 +00:00
added documentation
This commit is contained in:
parent
281459cac1
commit
9fcf0386c5
3 changed files with 5 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ import sys
|
|||
|
||||
|
||||
def get_version_changelog(version: str):
|
||||
"""Get changelog entry from CHANGELOG.md for given version"""
|
||||
with open('CHANGELOG.md', 'r') as file:
|
||||
content = file.read()
|
||||
pattern = rf"### {version} \(\d\d-\d\d-\d{{4}}\)\n(.*?)(?=### \d+\.\d+\.\d+|\Z)"
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import json
|
|||
|
||||
|
||||
def get_latest():
|
||||
"""Get latest version entry from index.json"""
|
||||
with open('index.json', 'r') as file:
|
||||
content = json.loads(file.read())
|
||||
latest_version = list(content["versions"].keys())[0]
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ from get_latest import get_latest
|
|||
|
||||
|
||||
def semantic_to_str(semantic_version: str):
|
||||
"""Convert version in the form of v1.2.3 to 001002003
|
||||
for comparing 2 version in semantic versioning format"""
|
||||
out = ""
|
||||
for i in (semantic_version.split(".")):
|
||||
if len(i) == 1:
|
||||
|
|
@ -13,6 +15,7 @@ def semantic_to_str(semantic_version: str):
|
|||
|
||||
|
||||
def version_is_lower(version: str):
|
||||
"""Check if given version is lower than the latest entry in index.json"""
|
||||
latest = semantic_to_str(get_latest())
|
||||
version = semantic_to_str(version)
|
||||
if latest > version:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue