add mixpanel to emulator
@@ -53,7 +53,7 @@ func ConfiguredServiceKey(
var state *flowkit.State
var err error
loader := &afero.Afero{Fs: afero.NewOsFs()}
-
+ handleUserTracking(loader)
if init {
if sigAlgo == crypto.UnknownSignatureAlgorithm {
sigAlgo = emulator.DefaultServiceKeySigAlgo
@@ -112,6 +112,19 @@ func init() {
Cmd.Use = "emulator"
}
+func handleUserTracking(loader flowkit.ReaderWriter) {
+ if util.MIXPANEL_PROJECT_TOKEN == "" {
+ return
+ }
+ metricsEnabled, err := util.CheckMetricsEnabled(loader)
+ if err != nil {
+ return
+ }
+ if metricsEnabled {
+ _ = util.TrackCommandUsage(Cmd)
+ }
+}
+
func Exitf(code int, msg string, args ...interface{}) {
fmt.Printf(msg+"\n", args...)
os.Exit(code)
