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:
@@ -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)")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user