Skip to content

Commit

Permalink
chore: removes bar on normal analyze events
Browse files Browse the repository at this point in the history
Signed-off-by: AlexsJones <alexsimonjones@gmail.com>
  • Loading branch information
AlexsJones committed Apr 1, 2023
1 parent f337f6b commit 96d0d75
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions cmd/analyze/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,14 @@ var AnalyzeCmd = &cobra.Command{
os.Exit(1)
}

var bar *progressbar.ProgressBar
if len(*analysisResults) > 0 {
bar = progressbar.Default(int64(len(*analysisResults)))
} else {
if len(*analysisResults) == 0 {
color.Green("{ \"status\": \"OK\" }")
os.Exit(0)
}

// This variable is used to store the results that will be printed
// It's necessary because the heap memory is lost when the function returns
var bar = progressbar.Default(int64(len(*analysisResults)))
if !explain {
bar.Clear()
}
var printOutput []analyzer.Analysis

for _, analysis := range *analysisResults {
Expand Down

0 comments on commit 96d0d75

Please sign in to comment.