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

Commit

Permalink
Add stdoutCallback expression
Browse files Browse the repository at this point in the history
  • Loading branch information
hlovdal authored and adiazulay committed Jan 19, 2021
1 parent 4aa7ddc commit 335d80a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/arduino/arduino.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,18 @@ export class ArduinoApp {
}
}

// TODO: Get rid of spawn's channel parameter and just support
// stdout and stderr callbacks
const stdoutCallback = (line: string) => {
arduinoChannel.channel.append(line);
}

await util.spawn(
this._settings.commandPath,
arduinoChannel.channel,
args,
undefined,
stdoutCallback,
).then(async () => {
await cleanup();
arduinoChannel.end(`${buildMode} sketch '${dc.sketch}'${os.EOL}`);
Expand Down Expand Up @@ -345,12 +353,18 @@ export class ArduinoApp {
await Promise.resolve();
}

// TODO: Get rid of spawn's channel parameter and just support
// stdout and stderr callbacks
const stdoutCallback = (line: string) => {
arduinoChannel.channel.append(line);
}

await util.spawn(
this._settings.commandPath,
arduinoChannel.channel,
args,
undefined,
compilerParserContext.callback,
stdoutCallback,
).then(async () => {
await cleanup();
arduinoChannel.end(`${buildMode} sketch '${dc.sketch}'${os.EOL}`);
Expand Down

0 comments on commit 335d80a

Please sign in to comment.