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:
@@ -75,6 +75,12 @@ Examples:
|
|||||||
}
|
}
|
||||||
|
|
||||||
func runFeed(cmd *cobra.Command, args []string) error {
|
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
|
// Determine working directory
|
||||||
workDir, err := os.Getwd()
|
workDir, err := os.Getwd()
|
||||||
if err != nil {
|
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 --rig specified, find that rig's beads directory
|
||||||
if feedRig != "" {
|
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
|
// Try common beads locations for the rig
|
||||||
candidates := []string{
|
candidates := []string{
|
||||||
fmt.Sprintf("%s/%s/mayor/rig", townRoot, feedRig),
|
fmt.Sprintf("%s/%s/mayor/rig", townRoot, feedRig),
|
||||||
|
|||||||
Reference in New Issue
Block a user