Skip to content

Commit

Permalink
Merge pull request aquasecurity#32 from tomoyamachi/fix_quiet_bug
Browse files Browse the repository at this point in the history
fix --quiet bug
  • Loading branch information
tomoyamachi committed May 19, 2019
2 parents cd04c0b + e95c619 commit 58bf4b2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkg/run.go
Expand Up @@ -26,6 +26,7 @@ import (
func Run(c *cli.Context) (err error) {
cliVersion := c.App.Version

utils.Quiet = c.Bool("quiet")
debug := c.Bool("debug")
if err = log.InitLogger(debug); err != nil {
l.Fatal(err)
Expand Down Expand Up @@ -83,7 +84,7 @@ func Run(c *cli.Context) (err error) {
needRefresh := false
dbVersion := db.GetVersion()
if dbVersion != "" && dbVersion != cliVersion {
if !autoRefresh {
if !refresh && !autoRefresh {
return xerrors.New("Detected version update of trivy. Please try again with --refresh or --auto-refresh option")
}
needRefresh = true
Expand All @@ -95,7 +96,6 @@ func Run(c *cli.Context) (err error) {
return xerrors.Errorf("error in refresh DB: %w", err)
}
}

if !skipUpdate {
if err = vulnsrc.Update(); err != nil {
return xerrors.Errorf("error in vulnerability DB update: %w", err)
Expand All @@ -107,8 +107,6 @@ func Run(c *cli.Context) (err error) {
return nil
}

utils.Quiet = c.Bool("quiet")

o := c.String("output")
output := os.Stdout
if o != "" {
Expand Down

0 comments on commit 58bf4b2

Please sign in to comment.