Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Commit 335d80a

Browse files
hlovdaladiazulay
authored andcommitted
Add stdoutCallback expression
1 parent 4aa7ddc commit 335d80a

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/arduino/arduino.ts

+15-1
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,18 @@ export class ArduinoApp {
254254
}
255255
}
256256

257+
// TODO: Get rid of spawn's channel parameter and just support
258+
// stdout and stderr callbacks
259+
const stdoutCallback = (line: string) => {
260+
arduinoChannel.channel.append(line);
261+
}
262+
257263
await util.spawn(
258264
this._settings.commandPath,
259265
arduinoChannel.channel,
260266
args,
267+
undefined,
268+
stdoutCallback,
261269
).then(async () => {
262270
await cleanup();
263271
arduinoChannel.end(`${buildMode} sketch '${dc.sketch}'${os.EOL}`);
@@ -345,12 +353,18 @@ export class ArduinoApp {
345353
await Promise.resolve();
346354
}
347355

356+
// TODO: Get rid of spawn's channel parameter and just support
357+
// stdout and stderr callbacks
358+
const stdoutCallback = (line: string) => {
359+
arduinoChannel.channel.append(line);
360+
}
361+
348362
await util.spawn(
349363
this._settings.commandPath,
350364
arduinoChannel.channel,
351365
args,
352366
undefined,
353-
compilerParserContext.callback,
367+
stdoutCallback,
354368
).then(async () => {
355369
await cleanup();
356370
arduinoChannel.end(`${buildMode} sketch '${dc.sketch}'${os.EOL}`);

0 commit comments

Comments
 (0)