Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions bin/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,13 @@ def main() -> int:
"response": {"error": str(e)},
})

if cache_dirty:
try:
save_cache(args.cache_file, cache)
except Exception as e:
print(f"[!] Unable to save cache file {args.cache_file}: {e}", file=sys.stderr)
return 1

if args.unified_output and not suppress_standard_json_output:
print(json.dumps(merged_output, indent=2, sort_keys=True))

Expand All @@ -1083,16 +1090,13 @@ def main() -> int:
if args.markdown_output == "-":
print(markdown_report)
else:
with open(args.markdown_output, "w", encoding="utf-8") as f:
f.write(markdown_report)
log(f"Wrote markdown report to {args.markdown_output}")

if cache_dirty:
try:
save_cache(args.cache_file, cache)
except Exception as e:
print(f"[!] Unable to save cache file {args.cache_file}: {e}", file=sys.stderr)
return 1
try:
with open(args.markdown_output, "w", encoding="utf-8") as f:
f.write(markdown_report)
log(f"Wrote markdown report to {args.markdown_output}")
except OSError as e:
print(f"[!] Unable to write markdown report to {args.markdown_output}: {e}", file=sys.stderr)
return 1

if not any_queried:
log("\nNo module query was executed successfully.")
Expand Down