Skip to content

Commit 2adbaf7

Browse files
authored
fix: read stdout before stderr (#41)
1 parent 40327fd commit 2adbaf7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/main.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -213,18 +213,18 @@ export class ExecProcess implements Result {
213213
let stderr = '';
214214
let stdout = '';
215215

216-
if (this._streamErr) {
217-
for await (const chunk of this._streamErr) {
218-
stderr += chunk.toString();
219-
}
220-
}
221-
222216
if (this._streamOut) {
223217
for await (const chunk of this._streamOut) {
224218
stdout += chunk.toString();
225219
}
226220
}
227221

222+
if (this._streamErr) {
223+
for await (const chunk of this._streamErr) {
224+
stderr += chunk.toString();
225+
}
226+
}
227+
228228
await this._processClosed;
229229

230230
if (this._options?.stdin) {

0 commit comments

Comments
 (0)