refactor: simplify code

main
sundowndev 2021-07-05 16:42:46 +02:00
parent 3c2694a897
commit b8ff26a44d
1 changed files with 4 additions and 3 deletions

View File

@ -227,9 +227,6 @@ func scanRun(opts *pkg.ScanOptions) error {
}()
analysis, err := ctl.Run()
if !opts.DisableTelemetry {
telemetry.SendTelemetry(store)
}
if err != nil {
return err
}
@ -242,6 +239,10 @@ func scanRun(opts *pkg.ScanOptions) error {
globaloutput.Printf(color.WhiteString("Scan duration: %s\n", analysis.Duration.Round(time.Second)))
globaloutput.Printf(color.WhiteString("Provider version used to scan: %s. Use --tf-provider-version to use another version.\n"), resourceSchemaRepository.ProviderVersion.String())
if !opts.DisableTelemetry {
telemetry.SendTelemetry(store)
}
if !analysis.IsSync() {
globaloutput.Printf("\nHint: use gen-driftignore command to generate a .driftignore file based on your drifts\n")