File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ builds:
3232 flags :
3333 - -mod=readonly
3434 ldflags :
35- - -X github.com/onflow/flow-cli/build.semver={{ .Env.VERSION }} -X github.com/onflow/flow-cli/internal/command.mixpanelToken={{ .Env.MIXPANEL_PROJECT_TOKEN }} -X github.com/onflow/flow-cli/internal/accounts.accountToken={{ .Env.LILICO_TOKEN }} -X github.com/onflow/flow-cli/internal/emulator/start.mixpanelToken={{ .Env.MIXPANEL_PROJECT_TOKEN }}
35+ - -X github.com/onflow/flow-cli/build.semver={{ .Env.VERSION }} -X github.com/onflow/flow-cli/internal/command.mixpanelToken={{ .Env.MIXPANEL_PROJECT_TOKEN }} -X github.com/onflow/flow-cli/internal/accounts.accountToken={{ .Env.LILICO_TOKEN }}
3636
3737archives :
3838 - id : golang-cross
Original file line number Diff line number Diff line change @@ -364,14 +364,14 @@ func initCrashReporting() {
364364}
365365
366366// The token is injected at build-time using ldflags
367- var mixpanelToken = ""
367+ var MixpanelToken = ""
368368
369369func UsageMetrics (command * cobra.Command , wg * sync.WaitGroup ) {
370- if ! settings .MetricsEnabled () || mixpanelToken == "" {
370+ if ! settings .MetricsEnabled () || MixpanelToken == "" {
371371 return
372372 }
373373 wg .Add (1 )
374- client := mixpanel .New (mixpanelToken , "" )
374+ client := mixpanel .New (MixpanelToken , "" )
375375
376376 // calculates a user ID that doesn't leak any personal information
377377 usr , _ := user .Current () // ignore err, just use empty string
Original file line number Diff line number Diff line change @@ -46,9 +46,6 @@ import (
4646
4747var Cmd * cobra.Command
4848
49- // The token is injected at build-time using ldflags
50- var mixpanelToken = ""
51-
5249// Mixpanel client to be reused on each http request of the middleware
5350var mixpanelClient mixpanel.Mixpanel
5451
@@ -137,8 +134,8 @@ func trackRequestMiddleware(next http.Handler) http.Handler {
137134
138135func init () {
139136 // Initialize mixpanel client only if metrics are enabled and token is not empty
140- if settings .MetricsEnabled () && mixpanelToken != "" {
141- mixpanelClient = mixpanel .New (mixpanelToken , "" )
137+ if settings .MetricsEnabled () && command . MixpanelToken != "" {
138+ mixpanelClient = mixpanel .New (command . MixpanelToken , "" )
142139 Cmd = start .Cmd (start.StartConfig {
143140 GetServiceKey : configuredServiceKey ,
144141 RestMiddlewares : []start.HttpMiddleware {trackRequestMiddleware },
You can’t perform that action at this time.
0 commit comments