From a60f346a5a3a2ac93e55a243e4f89ef96aeb3419 Mon Sep 17 00:00:00 2001 From: Moritz Warning Date: Thu, 20 Aug 2020 10:05:53 +0200 Subject: [PATCH] use os.makedirs and remove redundant mkdir lines --- misc/collect.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/misc/collect.py b/misc/collect.py index b4a9e12..d5983a0 100755 --- a/misc/collect.py +++ b/misc/collect.py @@ -129,7 +129,7 @@ def scrape(args): profiles = handle_release(f"{url}/{path}") output = merge_profiles(profiles, download_url) if len(output) > 0: - Path(f"{data_path}/{release}").mkdir(parents=True, exist_ok=True) + os.makedirs(f"{data_path}/{release}", exist_ok=True) # write overview.json with open(f"{data_path}/{release}/overview.json", "w") as outfile: if args.formatted: @@ -181,10 +181,9 @@ def scrape_wget(args): 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) + os.makedirs(f"{data_path}/{release}", exist_ok=True) # write overview.json with open(f"{data_path}/{release}/overview.json", "w") as outfile: @@ -257,12 +256,11 @@ def scan(args): continue versions[release.upper()] = f"data/{release}/overview.json" - os.system(f"mkdir -p {selector_path}/data/{release}/") output = merge_profiles( profiles, f"https://{args.domain}/{base_dir}/targets/{{target}}" ) - Path(f"{data_path}/{release}").mkdir(parents=True, exist_ok=True) + os.makedirs(f"{data_path}/{release}", exist_ok=True) # write overview.json with open(f"{data_path}/{release}/overview.json", "w") as outfile: -- 2.30.2