fix: Require Gas Town workspace for gt feed

Fail fast with clear error when run outside ~/gt instead of
hanging while bd tries to start.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-28 16:36:09 -08:00
parent 17b892b196
commit bcf9994195

View File

@@ -75,6 +75,12 @@ Examples:
}
func runFeed(cmd *cobra.Command, args []string) error {
// Must be in a Gas Town workspace
townRoot, err := workspace.FindFromCwdOrError()
if err != nil {
return fmt.Errorf("not in a Gas Town workspace (run from ~/gt or a rig directory)")
}
// Determine working directory
workDir, err := os.Getwd()
if err != nil {
@@ -83,11 +89,6 @@ func runFeed(cmd *cobra.Command, args []string) error {
// If --rig specified, find that rig's beads directory
if feedRig != "" {
townRoot, err := workspace.FindFromCwdOrError()
if err != nil {
return fmt.Errorf("not in a Gas Town workspace: %w", err)
}
// Try common beads locations for the rig
candidates := []string{
fmt.Sprintf("%s/%s/mayor/rig", townRoot, feedRig),