File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed
Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -166,15 +166,16 @@ func init() {
166166 createCmd .RegisterFlagCompletionFunc ("preset" , completePresetNames )
167167}
168168
169-
170169// TODO: remove when matured — legacy fallback for users without [hooks] config.
171170func copyParentCLAUDEmd (wsPath string ) {
172171 src := filepath .Join (wsPath , ".." , "CLAUDE.md" )
173172 data , err := os .ReadFile (src )
174173 if err != nil {
175174 return
176175 }
177- os .WriteFile (filepath .Join (wsPath , "CLAUDE.md" ), data , 0o644 )
176+ if err := os .WriteFile (filepath .Join (wsPath , "CLAUDE.md" ), data , 0o644 ); err != nil {
177+ console .Warningf ("legacy CLAUDE.md copy failed: %s" , err )
178+ }
178179}
179180
180181func deriveName (branch string ) string {
Original file line number Diff line number Diff line change 44 "encoding/json"
55 "fmt"
66 "os"
7+ "path/filepath"
78
89 "github.com/nicksenap/grove/internal/config"
910 "github.com/nicksenap/grove/internal/console"
@@ -77,11 +78,15 @@ func checkMissingHooks() []models.DoctorIssue {
7778 }
7879
7980 if _ , ok := cfg .Hooks ["post_create" ]; ! ok {
80- issues = append (issues , models.DoctorIssue {
81- Workspace : "—" ,
82- Issue : "no post_create hook configured (using legacy CLAUDE.md copy)" ,
83- SuggestedAction : `add [hooks] post_create = "cp {path}/../CLAUDE.md {path}/CLAUDE.md 2>/dev/null || true"` ,
84- })
81+ // Only flag if ~/.claude exists — user is a Claude Code user.
82+ home , _ := os .UserHomeDir ()
83+ if _ , err := os .Stat (filepath .Join (home , ".claude" )); err == nil {
84+ issues = append (issues , models.DoctorIssue {
85+ Workspace : "—" ,
86+ Issue : "no post_create hook configured (using legacy CLAUDE.md copy)" ,
87+ SuggestedAction : `add [hooks] post_create = "cp {path}/../CLAUDE.md {path}/CLAUDE.md 2>/dev/null || true"` ,
88+ })
89+ }
8590 }
8691
8792 return issues
You can’t perform that action at this time.
0 commit comments