fix(install): allow --wrappers in existing town without recreating HQ (#366)

When running `gt install --wrappers` in an existing Gas Town HQ,
the command now installs wrappers directly without requiring --force
or recreating the entire HQ structure.

Previously, `gt install --wrappers` would fail with "directory is
already a Gas Town HQ" unless --force was used, which would then
unnecessarily reinitialize the entire workspace.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Erik LaBianca
2026-01-11 21:45:24 -05:00
committed by GitHub
parent d126c967a0
commit 7ef4ddab6c
2 changed files with 63 additions and 0 deletions

View File

@@ -109,6 +109,14 @@ func runInstall(cmd *cobra.Command, args []string) error {
// Check if already a workspace
if isWS, _ := workspace.IsWorkspace(absPath); isWS && !installForce {
// If only --wrappers is requested in existing town, just install wrappers and exit
if installWrappers {
if err := wrappers.Install(); err != nil {
return fmt.Errorf("installing wrapper scripts: %w", err)
}
fmt.Printf("✓ Installed gt-codex and gt-opencode to %s\n", wrappers.BinDir())
return nil
}
return fmt.Errorf("directory is already a Gas Town HQ (use --force to reinitialize)")
}