diff --git a/cmd/install_script_test.go b/cmd/install_script_test.go new file mode 100644 index 0000000..7875004 --- /dev/null +++ b/cmd/install_script_test.go @@ -0,0 +1,31 @@ +package cmd + +import ( + "os" + "regexp" + "testing" +) + +func TestInstallScript(t *testing.T) { + data, err := os.ReadFile("../install.sh") + if err != nil { + t.Fatalf("could not read install.sh: %v", err) + } + content := string(data) + + t.Run("does not run setup wizard at install time", func(t *testing.T) { + // Match command execution shape only — not arbitrary text mentions. + setupInvocation := regexp.MustCompile(`(?m)^\s*"\$INSTALL_DIR/\$BINARY"\s+setup\b`) + if setupInvocation.MatchString(content) { + t.Error("install.sh must not run the setup subcommand at install time — the wizard now auto-launches from bare 'supermodel' in a project directory (PR #152)") + } + }) + + t.Run("includes getting-started message", func(t *testing.T) { + hasRunSupermodel := regexp.MustCompile(`(?i)\brun\s+['"]?supermodel['"]?\b`).MatchString(content) + hasProjectContext := regexp.MustCompile(`(?i)\b(in|inside)\s+your\s+project\b|\bproject\s+directory\b`).MatchString(content) + if !hasRunSupermodel || !hasProjectContext { + t.Error("install.sh must include a getting-started message directing users to run 'supermodel' in their project directory") + } + }) +} diff --git a/install.sh b/install.sh index aa0afab..b5a7610 100644 --- a/install.sh +++ b/install.sh @@ -73,10 +73,5 @@ install -m755 "$TMP/$BINARY" "$INSTALL_DIR/$BINARY" echo "Installed: $INSTALL_DIR/$BINARY" "$INSTALL_DIR/$BINARY" version -# Run the setup wizard when a controlling terminal is available. -# Use /dev/tty as stdin so interactive prompts work even in piped installs -# (e.g. curl … | sh), where stdin is the pipe rather than the terminal. -if { /dev/null; then - echo "" - "$INSTALL_DIR/$BINARY" setup