Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set: options don't apply to dynamically (shell) expanded variables #1901

Open
WinkelCode opened this issue Nov 2, 2024 · 1 comment
Open
Labels
state: needs triage Waiting to be triaged by a maintainer.

Comments

@WinkelCode
Copy link

version: "3"

set:
  - pipefail

tasks:
  default:
    vars:
      TESTVAR:
        sh: |-
          false | true
          echo "test"
    cmds:
      - |-
        false | true
        echo "Testing {{.TESTVAR}}"

When pipefail is enabled, the task command fails, but the TESTVAR expansion does not.

$ task -v
task: [REDACTED] Not found - Using alternative (Taskfile.yml)
task: dynamic variable: "false | true\necho \"test\"" result: "test"
task: "default" started
task: [default] false | true
echo "Testing test"
task: Failed to run task "default": exit status 1
  • Task version:
$ task --version
Task version: 3.39.2 ()
  • Operating system: macOS Sequoia 15.1
  • Experiments enabled: None
@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Nov 2, 2024
@WinkelCode WinkelCode changed the title set: option doesn't apply to dynamically (shell) expanded variables set: options don't apply to dynamically (shell) expanded variables Nov 2, 2024
@trulede
Copy link

trulede commented Nov 14, 2024

The seems the case, if you compare this:

opts := &execext.RunCommandOptions{

to that:

task/task.go

Line 388 in 6645a1f

err = execext.RunCommand(ctx, &execext.RunCommandOptions{

Perhaps it's reasonable to add PosixOpts and BashOpts to the call at line 157?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: needs triage Waiting to be triaged by a maintainer.
Projects
None yet
Development

No branches or pull requests

3 participants