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

--exit-code doesn't work for nested tasks #1266

Closed
Zebradil opened this issue Jul 17, 2023 · 2 comments · Fixed by #1270
Closed

--exit-code doesn't work for nested tasks #1266

Zebradil opened this issue Jul 17, 2023 · 2 comments · Fixed by #1270
Labels
type: bug Something not working as intended.

Comments

@Zebradil
Copy link

Setup

# ./Taskfile.yml

version: "3"

tasks:
  direct:
    cmds:
      - exit 42

  indirect:
    cmds:
      - task: direct

Test

$ task direct --exit-code; echo $?
task: [direct] exit 42
task: Failed to run task "direct": exit status 42
42
$ task indirect --exit-code; echo $?
task: [direct] exit 42
task: Failed to run task "indirect": task: Failed to run task "direct": exit status 42
201

Expected result

42
42

Actual result

42
201

Environment

  • Task version: Task version: v3.27.1
  • Operating system: x86_64 GNU/Linux
  • Experiments enabled:
@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Jul 17, 2023
@pd93
Copy link
Member

pd93 commented Jul 19, 2023

@Zebradil Thanks for the bug report. I've done a bit of digging and pushed up a PR: #1270. Please feel free to check it and see if it works for you.

@pd93 pd93 added type: bug Something not working as intended. and removed state: needs triage Waiting to be triaged by a maintainer. labels Jul 19, 2023
@Zebradil
Copy link
Author

Hey @pd93, thanks a lot for the quick fix. I have tested it, works as expected now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something not working as intended.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants