diff --git a/cmd/deepsource/main.go b/cmd/deepsource/main.go index b18b9d29..d25f8ed1 100644 --- a/cmd/deepsource/main.go +++ b/cmd/deepsource/main.go @@ -3,6 +3,7 @@ package main import ( "log" "os" + "time" "github.com/deepsourcelabs/cli/command" v "github.com/deepsourcelabs/cli/version" @@ -22,7 +23,6 @@ var ( ) func main() { - log.SetFlags(log.LstdFlags | log.Lshortfile) // Init sentry @@ -38,6 +38,7 @@ func main() { // TODO: Handle exit codes here pterm.Error.Println(err) sentry.CaptureException(err) + sentry.Flush(2 * time.Second) os.Exit(1) } } diff --git a/command/report/report.go b/command/report/report.go index 725d5e89..2e0c3489 100644 --- a/command/report/report.go +++ b/command/report/report.go @@ -7,6 +7,7 @@ import ( "io/ioutil" "os" "strings" + "time" "github.com/deepsourcelabs/cli/utils" "github.com/getsentry/sentry-go" @@ -30,6 +31,7 @@ func NewCmdReport() *cobra.Command { Args: utils.NoArgs, Run: func(cmd *cobra.Command, args []string) { returnCode := opts.Run() + sentry.Flush(2 * time.Second) defer os.Exit(returnCode) }, }