From 0c4f84dd2ecf039b5ed1dc7e69a523323f576108 Mon Sep 17 00:00:00 2001 From: Grey Newell Date: Thu, 30 Apr 2026 10:29:51 -0400 Subject: [PATCH 1/3] test: failing tests for install.sh wizard removal (#153, #158) --- cmd/install_script_test.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 cmd/install_script_test.go diff --git a/cmd/install_script_test.go b/cmd/install_script_test.go new file mode 100644 index 0000000..166208f --- /dev/null +++ b/cmd/install_script_test.go @@ -0,0 +1,31 @@ +package cmd + +import ( + "os" + "strings" + "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) { + // The script uses $BINARY variable, so match the literal subcommand argument + if strings.Contains(content, `" setup`) || strings.Contains(content, "supermodel setup") { + 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) { + lower := strings.ToLower(content) + hasRunSupermodel := strings.Contains(lower, "run 'supermodel'") || strings.Contains(lower, "run \"supermodel\"") + hasGetStarted := strings.Contains(lower, "get started") + if !hasRunSupermodel && !hasGetStarted { + t.Error("install.sh must include a getting-started message directing users to run 'supermodel' in their project directory") + } + }) +} From 9524266e563c5ca380d8443f748498dcb96bb678 Mon Sep 17 00:00:00 2001 From: Grey Newell Date: Thu, 30 Apr 2026 10:34:34 -0400 Subject: [PATCH 2/3] fix: remove install-time setup wizard, add getting-started message The wizard now auto-launches from bare 'supermodel' when run in a project directory (PR #152). Running it at install time starts watch in the wrong directory. Closes #153. Closes #158. Co-Authored-By: Claude Sonnet 4.6 --- install.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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 Date: Thu, 30 Apr 2026 10:39:38 -0400 Subject: [PATCH 3/3] refactor(test): use regex assertions in TestInstallScript Address CodeRabbit review: replace brittle substring checks with regex-based assertions that match command execution shape (not arbitrary text mentions) and accept valid guidance variations case-insensitively. Co-Authored-By: Claude Sonnet 4.6 --- cmd/install_script_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/install_script_test.go b/cmd/install_script_test.go index 166208f..7875004 100644 --- a/cmd/install_script_test.go +++ b/cmd/install_script_test.go @@ -2,7 +2,7 @@ package cmd import ( "os" - "strings" + "regexp" "testing" ) @@ -14,17 +14,17 @@ func TestInstallScript(t *testing.T) { content := string(data) t.Run("does not run setup wizard at install time", func(t *testing.T) { - // The script uses $BINARY variable, so match the literal subcommand argument - if strings.Contains(content, `" setup`) || strings.Contains(content, "supermodel setup") { + // 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) { - lower := strings.ToLower(content) - hasRunSupermodel := strings.Contains(lower, "run 'supermodel'") || strings.Contains(lower, "run \"supermodel\"") - hasGetStarted := strings.Contains(lower, "get started") - if !hasRunSupermodel && !hasGetStarted { + 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") } })