Skip to content

Commit

Permalink
fix: read stdout before stderr (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio authored Dec 28, 2024
1 parent 40327fd commit 2adbaf7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,18 +213,18 @@ export class ExecProcess implements Result {
let stderr = '';
let stdout = '';

if (this._streamErr) {
for await (const chunk of this._streamErr) {
stderr += chunk.toString();
}
}

if (this._streamOut) {
for await (const chunk of this._streamOut) {
stdout += chunk.toString();
}
}

if (this._streamErr) {
for await (const chunk of this._streamErr) {
stderr += chunk.toString();
}
}

await this._processClosed;

if (this._options?.stdin) {
Expand Down

0 comments on commit 2adbaf7

Please sign in to comment.