Skip to content

Commit 1ca9b6a

Browse files
nicksenapclaude
andcommitted
Fix code review issues in wizard.go
- Fix variable shadowing: rename inner exec.Cmd to hookCmd - Handle plugin.Find error instead of discarding it Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8a2e781 commit 1ca9b6a

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

cmd/wizard.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,16 @@ var wizardCmd = &cobra.Command{
6767

6868
// Offer to register Claude Code event hooks
6969
if console.Confirm("Register Claude Code session tracking hooks?", true) {
70-
pluginPath, _ := plugin.Find("claude")
71-
cmd := exec.Command(pluginPath, "hook", "install")
72-
cmd.Stdout = os.Stdout
73-
cmd.Stderr = os.Stderr
74-
if err := cmd.Run(); err != nil {
75-
console.Warningf("hook install failed: %s", err)
70+
pluginPath, findErr := plugin.Find("claude")
71+
if findErr != nil {
72+
console.Warningf("cannot find gw-claude: %s", findErr)
73+
} else {
74+
hookCmd := exec.Command(pluginPath, "hook", "install")
75+
hookCmd.Stdout = os.Stdout
76+
hookCmd.Stderr = os.Stderr
77+
if err := hookCmd.Run(); err != nil {
78+
console.Warningf("hook install failed: %s", err)
79+
}
7680
}
7781
}
7882
}

0 commit comments

Comments
 (0)