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

Function resolveInitTaskDir

apps/cli/internal/cli/project_init.go:216–234  ·  view source on GitHub ↗

resolveInitTaskDir returns the task directory path. If --task-dir was explicitly provided, uses that. If TTY, prompts the user. Otherwise uses the default.

(cmd *cobra.Command, isTTY bool)

Source from the content-addressed store, hash-verified

214// If --task-dir was explicitly provided, uses that.
215// If TTY, prompts the user. Otherwise uses the default.
216func resolveInitTaskDir(cmd *cobra.Command, isTTY bool) (string, error) {
217 if cmd.Flags().Changed("task-dir") {
218 return projectInitTaskDir, nil
219 }
220
221 if isTTY {
222 value := projectInitTaskDir // default for the prompt
223 err := huh.NewInput().
224 Title("Task directory").
225 Value(&value).
226 Run()
227 if err != nil {
228 return "", fmt.Errorf("prompt cancelled: %w", err)
229 }
230 return value, nil
231 }
232
233 return projectInitTaskDir, nil
234}
235
236// resolveInitAgents sets agent flags via prompt if none were explicitly set.
237func resolveInitAgents(isTTY bool) {

Callers 1

runProjectInitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected