Skip to content

Commit

Permalink
Inline and move appPath later
Browse files Browse the repository at this point in the history
  • Loading branch information
hlovdal authored and adiazulay committed Jan 19, 2021
1 parent 8227014 commit 88bed5e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/arduino/arduino.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ export class ArduinoApp {
return;
}

const appPath = path.join(ArduinoWorkspace.rootPath, dc.sketch);
if (!this.useArduinoCli()) {
args.push("--upload");
} else {
Expand All @@ -176,7 +175,7 @@ export class ArduinoApp {
if (dc.port) {
args.push("--port", dc.port);
}
args.push(appPath);

if (!await this.runPreBuildCommand(dc)) {
return;
}
Expand Down Expand Up @@ -211,6 +210,9 @@ export class ArduinoApp {
const restoreSerialMonitor = await SerialMonitor.getInstance().closeSerialMonitor(dc.port);
UsbDetector.getInstance().pauseListening();

// Push sketch as last argument
args.push(path.join(ArduinoWorkspace.rootPath, dc.sketch));

const cleanup = async () => {
UsbDetector.getInstance().resumeListening();
if (restoreSerialMonitor) {
Expand Down Expand Up @@ -264,15 +266,12 @@ export class ArduinoApp {
return false;
}

const appPath = path.join(ArduinoWorkspace.rootPath, dc.sketch);

if (!this.useArduinoCli()) {
args.push("--verify");
} else {
args.push("compile", "-b", boardDescriptor);
}

args.push(appPath);
const verbose = VscodeSettings.getInstance().logLevel === "verbose";
if (verbose) {
args.push("--verbose");
Expand Down Expand Up @@ -303,6 +302,9 @@ export class ArduinoApp {
let success = false;
const compilerParserContext = makeCompilerParserContext(dc);

// Push sketch as last argument
args.push(path.join(ArduinoWorkspace.rootPath, dc.sketch));

const cleanup = async () => {
await Promise.resolve();
}
Expand Down

0 comments on commit 88bed5e

Please sign in to comment.