task
task copied to clipboard
Avoid running prompt when status is met
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.