From: Moritz Warning Date: Thu, 20 Aug 2020 01:29:07 +0000 (+0200) Subject: skip releases that have no profiles.json X-Git-Tag: v3.0.0~24 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=7a1c8494fbf179f294d6978f1e2be1ba9a0e0a24;p=web%2Ffirmware-selector-openwrt-org.git skip releases that have no profiles.json --- diff --git a/misc/collect.py b/misc/collect.py index 2e6016d..df18e27 100755 --- a/misc/collect.py +++ b/misc/collect.py @@ -172,14 +172,17 @@ def scrape_wget(args): release = os.path.basename(path) base = path[len(tmp_dir) + 1 :] - versions[release.upper()] = f"data/{release}/overview.json" - os.system(f"mkdir -p {selector_path}/data/{release}/") - profiles = {} for ppath in Path(path).rglob("profiles.json"): with open(ppath, "r") as file: profiles[ppath] = file.read() + if len(profiles) == 0: + continue + + versions[release.upper()] = f"data/{release}/overview.json" + os.system(f"mkdir -p {selector_path}/data/{release}/") + output = merge_profiles(profiles, f"https://{base}/targets/{{target}}") Path(f"{data_path}/{release}").mkdir(parents=True, exist_ok=True)