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

fix: mixin ProcessOutput data to promisified pipe value #954

Merged
merged 1 commit into from
Nov 24, 2024

Conversation

antongolub
Copy link
Collaborator

continues #949

Promisified pipe result exposes the closest left ProcessOutput data for backward compatibility

const file = tempfile()
const fileStream = fs.createWriteStream(file)
const p = $`echo "hello"`
  .pipe(getUpperCaseTransform())
  .pipe(fileStream)
const o = await p

assert.ok(p instanceof WriteStream)
assert.ok(o instanceof WriteStream)
assert.equal(o.stdout, 'hello\n')
assert.equal(o.exitCode, 0)
assert.equal((await fs.readFile(file)).toString(), 'HELLO\n')
  • Tests pass

@antongolub antongolub requested a review from antonmedv November 24, 2024 16:00
@antonmedv antonmedv merged commit 3b9afe1 into google:main Nov 24, 2024
21 checks passed
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