Skip to content

fix(cli/api): drain stdout before exit to avoid pipe truncation#60

Merged
jamie-at-bunny merged 2 commits intomainfrom
fix/cli-api-pipe-truncation
May 7, 2026
Merged

fix(cli/api): drain stdout before exit to avoid pipe truncation#60
jamie-at-bunny merged 2 commits intomainfrom
fix/cli-api-pipe-truncation

Conversation

@jamie-at-bunny
Copy link
Copy Markdown
Member

Large JSON responses piped to another process (e.g. bunny api GET /pullzone | jq) were truncated mid-string because console.log to a POSIX pipe is async and the process exited before the buffer drained.

Switching to process.stdout.write with an awaited callback so the handler waits for the kernel to accept the data before returning.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 6, 2026

🦋 Changeset detected

Latest commit: afc70ed

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@bunny.net/cli Patch
@bunny.net/cli-linux-x64 Patch
@bunny.net/cli-linux-arm64 Patch
@bunny.net/cli-darwin-x64 Patch
@bunny.net/cli-darwin-arm64 Patch
@bunny.net/cli-windows-x64 Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jamie-at-bunny jamie-at-bunny merged commit f9cbdbb into main May 7, 2026
1 check passed
@jamie-at-bunny jamie-at-bunny deleted the fix/cli-api-pipe-truncation branch May 7, 2026 07:47
@github-actions github-actions Bot mentioned this pull request May 7, 2026
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.

1 participant