Fix deacon role detection: start in deacon/ directory
The deacon was being detected as Mayor because it started in ~/gt (town root). Now starts in ~/gt/deacon/ so gt prime correctly detects RoleDeacon. Also ensures deacon directory exists on start.
This commit is contained in:
@@ -3,6 +3,8 @@ package cmd
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -130,9 +132,17 @@ func startDeaconSession(t *tmux.Tmux) error {
|
|||||||
return fmt.Errorf("not in a Gas Town workspace: %w", err)
|
return fmt.Errorf("not in a Gas Town workspace: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create session in workspace root
|
// Deacon runs from its own directory (for correct role detection by gt prime)
|
||||||
|
deaconDir := filepath.Join(townRoot, "deacon")
|
||||||
|
|
||||||
|
// Ensure deacon directory exists
|
||||||
|
if err := os.MkdirAll(deaconDir, 0755); err != nil {
|
||||||
|
return fmt.Errorf("creating deacon directory: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create session in deacon directory
|
||||||
fmt.Println("Starting Deacon session...")
|
fmt.Println("Starting Deacon session...")
|
||||||
if err := t.NewSession(DeaconSessionName, townRoot); err != nil {
|
if err := t.NewSession(DeaconSessionName, deaconDir); err != nil {
|
||||||
return fmt.Errorf("creating session: %w", err)
|
return fmt.Errorf("creating session: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user