fix: ensure gitignore patterns on role creation
Add EnsureGitignorePatterns to rig package that ensures .gitignore has required Gas Town patterns (.runtime/, .claude/, .beads/, .logs/). Called from crew and polecat managers when creating new workers. This prevents runtime-gitignore warnings from gt doctor. The function: - Creates .gitignore if it doesn't exist - Appends missing patterns to existing files - Recognizes pattern variants (.runtime vs .runtime/) - Adds "# Gas Town" header when appending Includes comprehensive tests for all scenarios.
This commit is contained in:
committed by
Steve Yegge
parent
05ea767149
commit
2aadb0165b
@@ -188,6 +188,12 @@ func (m *Manager) Add(name string, createBranch bool) (*CrewWorker, error) {
|
||||
fmt.Printf("Warning: could not copy overlay files: %v\n", err)
|
||||
}
|
||||
|
||||
// Ensure .gitignore has required Gas Town patterns
|
||||
if err := rig.EnsureGitignorePatterns(crewPath); err != nil {
|
||||
// Non-fatal - log warning but continue
|
||||
fmt.Printf("Warning: could not update .gitignore: %v\n", err)
|
||||
}
|
||||
|
||||
// NOTE: Slash commands (.claude/commands/) are provisioned at town level by gt install.
|
||||
// All agents inherit them via Claude's directory traversal - no per-workspace copies needed.
|
||||
|
||||
@@ -581,3 +587,4 @@ func (m *Manager) IsRunning(name string) (bool, error) {
|
||||
sessionID := m.SessionName(name)
|
||||
return t.HasSession(sessionID)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user