Description
Given the following Taskfile:
---
version: 3
tasks:
example:
status:
- "! which badcommand"
cmds:
- echo running task
I would expect the example task to NOT run, given that ! which badcommand will surely exit 0. However, Task is reporting that the status command is exiting non-zero and executes the task:
$ task example -v
task: "example" started
task: status command ! which badcommand exited non-zero: exit status 1
task: [example] echo runnning task
runnning task
task: "example" finished
The workaround is to use bash -c "! which badcommand" but I think this is suboptimal.
Version
3.46.4
Operating system
macos v26.2
Experiments Enabled
No response
Example Taskfile
---
version: 3
tasks:
example:
status:
- "! which badcommand"
cmds:
- echo running task
Description
Given the following Taskfile:
I would expect the
exampletask to NOT run, given that! which badcommandwill surely exit 0. However, Task is reporting that the status command is exiting non-zero and executes the task:The workaround is to use
bash -c "! which badcommand"but I think this is suboptimal.Version
3.46.4
Operating system
macos v26.2
Experiments Enabled
No response
Example Taskfile