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 result.pipedFrom #72

Merged
merged 1 commit into from
Sep 7, 2024
Merged

Add result.pipedFrom #72

merged 1 commit into from
Sep 7, 2024

Conversation

ehmicky
Copy link
Collaborator

@ehmicky ehmicky commented Sep 6, 2024

This PR adds result.pipedFrom, like Execa. I.e. when using .pipe(), the result (or error) includes the source subprocess's result (or error), which is useful for debugging.

It turns out which roughly does not add any bytes because adding result.pipedFrom is straightforward, and allows for removing some other logic.

command: [
command,
raw.map(part => getCommandPart(stripVTControlCharacters(part))).join(' '),
].filter(Boolean).join(' | '),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can now use result.pipedFrom.command instead.

@sindresorhus sindresorhus merged commit d722a9f into main Sep 7, 2024
12 checks passed
@sindresorhus sindresorhus deleted the piped-from branch September 7, 2024 05:01
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