add version info and remove double config call (#977)

This commit is contained in:
Christopher Angelo Phillips 2022-05-02 10:54:10 -04:00 committed by GitHub
parent 36973021fa
commit 4ce2edda9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -49,9 +49,6 @@ func Attest(v *viper.Viper, app *config.Application, ro *options.RootOptions) *c
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
// this MUST be called first to make sure app config decodes // this MUST be called first to make sure app config decodes
// the viper object correctly // the viper object correctly
newLogWrapper(app)
logApplicationConfig(app)
if app.CheckForAppUpdate { if app.CheckForAppUpdate {
checkForApplicationUpdate() checkForApplicationUpdate()
} }

View File

@ -123,6 +123,8 @@ func checkForApplicationUpdate() {
} }
func logApplicationConfig(app *config.Application) { func logApplicationConfig(app *config.Application) {
versionInfo := version.FromBuild()
log.Infof("syft version: %+v", versionInfo.Version)
log.Debugf("application config:\n%+v", color.Magenta.Sprint(app.String())) log.Debugf("application config:\n%+v", color.Magenta.Sprint(app.String()))
} }