File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,11 @@ import (
3232func Execute () {
3333 ctx := telemetry .NewContext ()
3434 rootCmd := atlas .Builder ()
35- if err := rootCmd .ExecuteContext (ctx ); err != nil {
35+ if cmd , err := rootCmd .ExecuteContextC (ctx ); err != nil {
36+ if ! telemetry .StartedTrackingCommand () {
37+ telemetry .StartTrackingCommand (cmd , os .Args [1 :])
38+ }
39+
3640 telemetry .FinishTrackingCommand (telemetry.TrackOptions {
3741 Err : err ,
3842 })
Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ type TrackOptions struct {
2727
2828var currentTracker * tracker
2929
30+ func StartedTrackingCommand () bool {
31+ return currentTracker != nil
32+ }
33+
3034func StartTrackingCommand (cmd * cobra.Command , args []string ) {
3135 if ! config .TelemetryEnabled () {
3236 return
You can’t perform that action at this time.
0 commit comments