Get this JSON generator over the line
This commit is contained in:
parent
e881f8007e
commit
26e839ea7b
10
app-json.py
10
app-json.py
@ -55,7 +55,7 @@ def gen_apps_json():
|
||||
"category": "apps",
|
||||
"repository": f"https://git.autonomic.zone/coop-cloud/{app}.git",
|
||||
"features": get_app_features(app_path),
|
||||
"versions": get_app_versions(),
|
||||
"versions": get_app_versions(app_path),
|
||||
}
|
||||
|
||||
return apps_json
|
||||
@ -68,13 +68,13 @@ def get_app_features(app_path):
|
||||
contents = handle.read()
|
||||
|
||||
for match in findall(r"\*\*.*\s\*", contents):
|
||||
title = search(r"\*\*.*\*\*", match).group().replace("*", "").lower()
|
||||
title = search(r"(?<=\*\*).*(?=\*\*)", match).group().lower()
|
||||
if title == "image":
|
||||
value = {
|
||||
"image": search(r"(?<=`).*(?=`)", match).group(),
|
||||
"url": search(r"(?<=\().*(?=\))", match).group(),
|
||||
"rating": "",
|
||||
"source": "",
|
||||
"rating": match.split(",")[1].strip(),
|
||||
"source": match.split(",")[-1].replace("*", "").strip(),
|
||||
}
|
||||
else:
|
||||
value = match.split(":")[-1].replace("*", "").strip()
|
||||
@ -87,7 +87,7 @@ def get_app_versions(app_path):
|
||||
versions = {}
|
||||
|
||||
chdir(app_path)
|
||||
tags = check_output(f"git tag --list").strip()
|
||||
tags = check_output(f"git tag --list", shell=True).strip()
|
||||
for tag in tags:
|
||||
# TODO
|
||||
# checkout that tag in the local git branch
|
||||
|
Reference in New Issue
Block a user