go-task / task

A task runner / simpler Make alternative written in Go
https://taskfile.dev
MIT License
11.57k stars 618 forks source link

Multiple prompts #1861

Closed MalteMagnussen closed 1 month ago

MalteMagnussen commented 1 month ago

I'd love to be able to give "prompt" an array of prompts.

We have a task that releases to production. Right now we have one prompt that contains multiple questions and checks for the user.

I'd like to split those questions into multiple.

So instead of

version: '3'
tasks:
  deploy:production:
    desc: Release to prod
    prompt: "Do you wish to release to version {{.RELEASE_VERSION}}? Have you remembered to log into harbor today? Have you announced the release on Slack and aligned with team Foo?"

I'd like to do this

version: '3'
tasks:
  deploy:production:
    desc: Release to prod
    prompt:
    - Do you wish to release to version {{.RELEASE_VERSION}}? 
    - Have you remembered to log into harbor today? 
    - Have you announced the release on Slack? 
    - Have you aligned with team Foo? 
mfbmina commented 1 month ago

@andreynering I want to contribute to this issue! What do you believe is the best way to go?

  1. Prompt can be a single string or multiple values
  2. Prompt for one value and prompts for multiple values?
andreynering commented 1 month ago

Hi @mfbmina,

Contributions are welcome!

Option 1 would better align with our current conventions. Allow a single string or an array of strings on prompt:.

mfbmina commented 1 month ago

Hey @andreynering!

When you're free, could you look at the PR above?

Thanks 😄