Skip to content

Commit

Permalink
remove json/csv extension for json/csv only output
Browse files Browse the repository at this point in the history
  • Loading branch information
dogancanbakir committed Jul 7, 2023
1 parent 6c60f56 commit 31f85f1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 31f85f1

Please sign in to comment.