skip releases that have no profiles.json
authorMoritz Warning <moritzwarning@web.de>
Thu, 20 Aug 2020 01:29:07 +0000 (03:29 +0200)
committerMoritz Warning <moritzwarning@web.de>
Thu, 20 Aug 2020 12:43:02 +0000 (14:43 +0200)
misc/collect.py

index 2e6016dd661f947cd6355e0db97ce03d9f99a21f..df18e278b485634095331faf880dd9b89c4d5f40 100755 (executable)
@@ -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)