MCPcopy Create free account
hub / github.com/driangle/taskmd / resolveInitTemplates

Function resolveInitTemplates

apps/cli/internal/cli/project_init.go:285–306  ·  view source on GitHub ↗

resolveInitTemplates sets projectInitNoTemplates via prompt if not explicitly set.

(isTTY bool)

Source from the content-addressed store, hash-verified

283
284// resolveInitTemplates sets projectInitNoTemplates via prompt if not explicitly set.
285func 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.

Callers 1

runProjectInitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected