resolveInitTemplates sets projectInitNoTemplates via prompt if not explicitly set.
(isTTY bool)
| 283 | |
| 284 | // resolveInitTemplates sets projectInitNoTemplates via prompt if not explicitly set. |
| 285 | func resolveInitTemplates(isTTY bool) { |
| 286 | if projectInitNoTemplates { |
| 287 | return |
| 288 | } |
| 289 | |
| 290 | if !isTTY { |
| 291 | return |
| 292 | } |
| 293 | |
| 294 | include := true |
| 295 | err := huh.NewConfirm(). |
| 296 | Title("Include task templates?"). |
| 297 | Description("Copies built-in templates (feature, bug, chore) to .taskmd/templates/"). |
| 298 | Value(&include). |
| 299 | WithButtonAlignment(lipgloss.Left). |
| 300 | Run() |
| 301 | if err != nil { |
| 302 | // Cancelled: default to including templates |
| 303 | return |
| 304 | } |
| 305 | projectInitNoTemplates = !include |
| 306 | } |
| 307 | |
| 308 | // confirmInitPlan shows what will be created and asks the user to confirm. |
| 309 | // Returns true if the user confirms, false if cancelled. |