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

Fails when set -u is used #31

Open
towo opened this issue Oct 8, 2024 · 0 comments
Open

Fails when set -u is used #31

towo opened this issue Oct 8, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@towo
Copy link

towo commented Oct 8, 2024

Describe the Bug

When the bash setting -u is set to fail on usage of undefined variables, the task helper exits after execution.

Expected Behavior

That it doesn't.

Steps to Reproduce

  1. Create a task.
  2. Use set -euo pipefail.

Environment

  • Version: 2.0.0
  • Platform: Debian 12

Additional Context

The error doesn't happen when using e.g. set -eo pipefail.

While testing, I noticed that it does not happen when the there is at least one task-output command between the source call and set -euo pipefail, that is:

source bash_task_helper/files/task_helper.sh
echo foo
set -euo pipefail
task-succeed baz

does not work, but

source bash_task_helper/files/task_helper.sh
task-output foo bar
set -euo pipefail
task-succeed baz

works:

{
  "foo": "bar",
  "status": "success",
  "_output": "baz"
}
@towo towo added the bug Something isn't working label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant