From 31f85f15a4012a2877002126a0b6f2eab220bfa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Do=C4=9Fan=20Can=20Bak=C4=B1r?= Date: Fri, 7 Jul 2023 07:15:25 +0000 Subject: [PATCH] remove json/csv extension for json/csv only output --- runner/runner.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/runner/runner.go b/runner/runner.go index 55c23b71..c5e2f8d6 100644 --- a/runner/runner.go +++ b/runner/runner.go @@ -627,12 +627,12 @@ func (r *Runner) RunEnumeration() { } if r.options.Output != "" && r.options.JSONOutput && jsonFile == nil { - jsonFile = openOrCreateFile(r.options.Resume, r.options.Output+".json") + jsonFile = openOrCreateFile(r.options.Resume, r.options.Output) defer jsonFile.Close() } if r.options.Output != "" && r.options.CSVOutput && csvFile == nil { - csvFile = openOrCreateFile(r.options.Resume, r.options.Output+".csv") + csvFile = openOrCreateFile(r.options.Resume, r.options.Output) defer csvFile.Close() } @@ -864,7 +864,9 @@ func (r *Runner) RunEnumeration() { } } - gologger.Silent().Msgf("%s\n", resp.str) + if notJsonOrCsv || r.options.OutputAll { + gologger.Silent().Msgf("%s\n", resp.str) + } //nolint:errcheck // this method needs a small refactor to reduce complexity if plainFile != nil {