(cwd string)
| 100 | return getTemplatePath() |
| 101 | } |
| 102 | |
| 103 | func projectTemplatePathForCWD(cwd string) (string, bool) { |
| 104 | if cwd != "" { |
| 105 | current, err := resolveAbsPath(cwd) |
| 106 | if err == nil { |
| 107 | if info, statErr := os.Stat(current); statErr == nil && !info.IsDir() { |
| 108 | current = filepath.Dir(current) |
| 109 | } |
| 110 | for { |
| 111 | candidate := apppaths.ProjectSystemPrompt(current) |
| 112 | if fileExists(candidate) { |
| 113 | return candidate, true |
| 114 | } |
| 115 | parent := filepath.Dir(current) |
| 116 | if parent == current { |
| 117 | break |
| 118 | } |
| 119 | current = parent |
| 120 | } |
| 121 | } |
| 122 | } |
| 123 | return "", false |
| 124 | } |
| 125 | |
| 126 | type PromptSection struct { |
no test coverage detected