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

Add pipefail module #1010

Closed
wants to merge 1 commit into from
Closed

Add pipefail module #1010

wants to merge 1 commit into from

Conversation

132ikl
Copy link
Contributor

@132ikl 132ikl commented Jan 6, 2025

Allows users to trade external command streaming for pipefail. This is a workaround until we have proper pipefail handling.

Still need to add docs/tests.

Usage:

use std-rfc/pipefail *
^false | print foo; print bar
# => Error: 
# =>   × External command failed
# =>    ╭─[entry #3:2:2]
# =>  2 │ ^false | print foo; print bar
# =>    ·  ──┬──
# =>    ·    ╰── command had a non-zero exit code
# =>    ╰────

@WindSoilder
Copy link
Contributor

WindSoilder commented Jan 6, 2025

I think it's still different to bash's pipefail.
In bash, when running false | echo aa, aa will be printed.

@132ikl
Copy link
Contributor Author

132ikl commented Jan 6, 2025

Oh, that's a good point. I tried to think of a way that a "collecting" version of pipefail could be compatible with a streaming version of pipefail (what bash does), but I think they're actually fundamentally different. I think that if we introduced some interim pipefail mechanism it needs to be compatible with whatever future (streaming-compatible) pipefail implementation we have, so I don't think this is going to work.

@132ikl 132ikl closed this Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants