Commit 0bb76c94 authored by Ondřej Borýsek's avatar Ondřej Borýsek
Browse files

Output meta file only for JSON output format

parent d77c39d0
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -542,14 +542,13 @@ def main(argv, reinit_global_vars: bool = False, s2r: 'Scan2ReportConfig' = None
        findings_json = produce_findings_json(findings, hostnames)
        with open(outfile, 'w', encoding="utf8") as f:
            json.dump(findings_json, f, indent=4, sort_keys=True)
    else:
        raise Exception('Unknown output file format:' + outfileFormat)

        with open(f"{outfile}.meta.json", 'w', encoding="utf8") as f:  # todo: make this a CLI argument?
            json.dump({
                'missing': missing_as_list,
                'services': services
            }, f, indent=4, sort_keys=True)
    else:
        raise Exception('Unknown output file format:' + outfileFormat)

    print('Report written:', outfile)