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

Commit 88bed5e

Browse files
hlovdaladiazulay
authored andcommitted
Inline and move appPath later
1 parent 8227014 commit 88bed5e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/arduino/arduino.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ export class ArduinoApp {
152152
return;
153153
}
154154

155-
const appPath = path.join(ArduinoWorkspace.rootPath, dc.sketch);
156155
if (!this.useArduinoCli()) {
157156
args.push("--upload");
158157
} else {
@@ -176,7 +175,7 @@ export class ArduinoApp {
176175
if (dc.port) {
177176
args.push("--port", dc.port);
178177
}
179-
args.push(appPath);
178+
180179
if (!await this.runPreBuildCommand(dc)) {
181180
return;
182181
}
@@ -211,6 +210,9 @@ export class ArduinoApp {
211210
const restoreSerialMonitor = await SerialMonitor.getInstance().closeSerialMonitor(dc.port);
212211
UsbDetector.getInstance().pauseListening();
213212

213+
// Push sketch as last argument
214+
args.push(path.join(ArduinoWorkspace.rootPath, dc.sketch));
215+
214216
const cleanup = async () => {
215217
UsbDetector.getInstance().resumeListening();
216218
if (restoreSerialMonitor) {
@@ -264,15 +266,12 @@ export class ArduinoApp {
264266
return false;
265267
}
266268

267-
const appPath = path.join(ArduinoWorkspace.rootPath, dc.sketch);
268-
269269
if (!this.useArduinoCli()) {
270270
args.push("--verify");
271271
} else {
272272
args.push("compile", "-b", boardDescriptor);
273273
}
274274

275-
args.push(appPath);
276275
const verbose = VscodeSettings.getInstance().logLevel === "verbose";
277276
if (verbose) {
278277
args.push("--verbose");
@@ -303,6 +302,9 @@ export class ArduinoApp {
303302
let success = false;
304303
const compilerParserContext = makeCompilerParserContext(dc);
305304

305+
// Push sketch as last argument
306+
args.push(path.join(ArduinoWorkspace.rootPath, dc.sketch));
307+
306308
const cleanup = async () => {
307309
await Promise.resolve();
308310
}

0 commit comments

Comments
 (0)