task icon indicating copy to clipboard operation
task copied to clipboard

Avoid running prompt when status is met

Open WnP opened this issue 2 years ago • 0 comments

Giving the fact that if status returns 0 the tasks is considered up-to-date and so cmds will no be executed, then could we avoid running the associated prompt?

For example, giving the following Taskfile:

version: "3"
tasks:
  clean:
    desc: Remove application folder if exists
    prompt: There's already an application named '{{.APP_NAME}}' do you want to remove it?
    cmds:
      - rm -r {{.APP_NAME}}
    status:
      - test ! -d {{.APP_NAME}}

In the above case we don't want to be prompted if the folder doesn't exists.

WnP avatar Sep 14 '23 08:09 WnP