on main help sign in
fix(posthog): correct bool prop name for non-interactive mode (#1771)
ca21111Andrey Nering
internal/cmd/run.go+1−1
@@ -59,7 +59,7 @@ crush run --quiet "Generate a README for this project"
59 return fmt.Errorf("no prompt provided")
59 return fmt.Errorf("no prompt provided")
60 }
60 }
61
61
62− event.SetInteractive(true)
62+ event.SetNonInteractive(true)
63 event.AppInitialized()
63 event.AppInitialized()
64
64
65 return app.RunNonInteractive(ctx, os.Stdout, prompt, quiet)
65 return app.RunNonInteractive(ctx, os.Stdout, prompt, quiet)
internal/event/event.go+5−3
@@ -15,6 +15,8 @@ import (
15const (
15const (
16 endpoint = "https://data.charm.land"
16 endpoint = "https://data.charm.land"
17 key = "phc_4zt4VgDWLqbYnJYEwLRxFoaTL2noNrQij0C6E8k3I0V"
17 key = "phc_4zt4VgDWLqbYnJYEwLRxFoaTL2noNrQij0C6E8k3I0V"
18+
19+ nonInteractiveEvenName = "NonInteractive"
18)
20)
19
21
20var (
22var (
@@ -27,11 +29,11 @@ var (
27 Set("SHELL", filepath.Base(os.Getenv("SHELL"))).
29 Set("SHELL", filepath.Base(os.Getenv("SHELL"))).
28 Set("Version", version.Version).
30 Set("Version", version.Version).
29 Set("GoVersion", runtime.Version()).
31 Set("GoVersion", runtime.Version()).
30− Set("Interactive", false)
32+ Set(nonInteractiveEvenName, false)
31)
33)
32
34
33−func SetInteractive(interactive bool) {
35+func SetNonInteractive(nonInteractive bool) {
34− baseProps = baseProps.Set("Interactive", interactive)
36+ baseProps = baseProps.Set(nonInteractiveEvenName, nonInteractive)
35}
37}
36
38
37func Init() {
39func Init() {