Bash c stdin was available to all commands vs. just the first one#105
Merged
cramforce merged 5 commits intovercel-labs:mainfrom Feb 10, 2026
Merged
Bash c stdin was available to all commands vs. just the first one#105cramforce merged 5 commits intovercel-labs:mainfrom
cramforce merged 5 commits intovercel-labs:mainfrom
Conversation
|
@robertlyates is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
|
@cramforce hopefully an easy merge, in more testing I discovered a bug / spec violation in my original PR - #102 the test case in here demonstrates the failure and then there's an easy fix, again, somewhat urgent on my side, appreciate all you're doing here |
cramforce
approved these changes
Feb 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
when data is piped into a bash script only the first command in the group should consume the data piped into the script
what was happening is that if a pipe was empty then it would fallback to the group stdin and this violates the expected behaviour for bash
e.g.
echo "test" | bash -c \'RESULT=$(cat | grep "nomatch" | head -1); echo "RESULT=[$RESULT]"\'head should have received an empty input but instead it got "test" piped into the group, with this fix only the first command gets the bash -c piped input
the PR includes a failing test case and a fix that allows the test case to pass