task icon indicating copy to clipboard operation
task copied to clipboard

Seems like `pipefail` is not applied to `status` commands

Open arikkfir opened this issue 3 months ago • 1 comments

Description

Taskfile:

version '3'

set:
  - errexit
  - nounset
  - pipefail
  - xtrace

...
  foo:
    cmd: echo RUNNING FOO
    status:
      - cat non-existent-file | jq '{}'
...

Running this:

$ task foo
task: Task "foo" is up to date

As a user, I expected pipefail to be applied and used for status commands as well, not just for cmd/cmds.

Version

3.45.4

Operating system

macOS

Experiments Enabled

No response

Example Taskfile

version '3'

set:
  - errexit
  - nounset
  - pipefail
  - xtrace

tasks:
  foo:
    cmd: echo RUNNING FOO
    status:
      - cat non-existent-file | jq '{}'

arikkfir avatar Oct 21 '25 10:10 arikkfir

@arikkfir Hi, I developed a draft PR for this. You might evaluate it and provide feedback, if it works as you expect (or not).

You can also not do this at all, and formulate your task like this:

version '3'

tasks:
  foo:
    cmd: echo RUNNING FOO
    status:
      - cat non-existent-file
      - jq '{}'

Which I think achieves the same effect.

trulede avatar Nov 30 '25 22:11 trulede