fix(posthog): correct bool prop name for non-interactive mode (#1771)

Andrey Nering and Christian Rocha created

Co-authored-by: Christian Rocha <christian@rocha.is>

Change summary

internal/cmd/run.go     | 2 +-
internal/event/event.go | 8 +++++---
2 files changed, 6 insertions(+), 4 deletions(-)

Detailed changes

internal/cmd/run.go 🔗

@@ -59,7 +59,7 @@ crush run --quiet "Generate a README for this project"
 			return fmt.Errorf("no prompt provided")
 		}
 
-		event.SetInteractive(true)
+		event.SetNonInteractive(true)
 		event.AppInitialized()
 
 		return app.RunNonInteractive(ctx, os.Stdout, prompt, quiet)

internal/event/event.go 🔗

@@ -15,6 +15,8 @@ import (
 const (
 	endpoint = "https://data.charm.land"
 	key      = "phc_4zt4VgDWLqbYnJYEwLRxFoaTL2noNrQij0C6E8k3I0V"
+
+	nonInteractiveEvenName = "NonInteractive"
 )
 
 var (
@@ -27,11 +29,11 @@ var (
 			Set("SHELL", filepath.Base(os.Getenv("SHELL"))).
 			Set("Version", version.Version).
 			Set("GoVersion", runtime.Version()).
-			Set("Interactive", false)
+			Set(nonInteractiveEvenName, false)
 )
 
-func SetInteractive(interactive bool) {
-	baseProps = baseProps.Set("Interactive", interactive)
+func SetNonInteractive(nonInteractive bool) {
+	baseProps = baseProps.Set(nonInteractiveEvenName, nonInteractive)
 }
 
 func Init() {