@@ -152,7 +152,6 @@ export class ArduinoApp {
152
152
return ;
153
153
}
154
154
155
- const appPath = path . join ( ArduinoWorkspace . rootPath , dc . sketch ) ;
156
155
if ( ! this . useArduinoCli ( ) ) {
157
156
args . push ( "--upload" ) ;
158
157
} else {
@@ -176,7 +175,7 @@ export class ArduinoApp {
176
175
if ( dc . port ) {
177
176
args . push ( "--port" , dc . port ) ;
178
177
}
179
- args . push ( appPath ) ;
178
+
180
179
if ( ! await this . runPreBuildCommand ( dc ) ) {
181
180
return ;
182
181
}
@@ -211,6 +210,9 @@ export class ArduinoApp {
211
210
const restoreSerialMonitor = await SerialMonitor . getInstance ( ) . closeSerialMonitor ( dc . port ) ;
212
211
UsbDetector . getInstance ( ) . pauseListening ( ) ;
213
212
213
+ // Push sketch as last argument
214
+ args . push ( path . join ( ArduinoWorkspace . rootPath , dc . sketch ) ) ;
215
+
214
216
const cleanup = async ( ) => {
215
217
UsbDetector . getInstance ( ) . resumeListening ( ) ;
216
218
if ( restoreSerialMonitor ) {
@@ -264,15 +266,12 @@ export class ArduinoApp {
264
266
return false ;
265
267
}
266
268
267
- const appPath = path . join ( ArduinoWorkspace . rootPath , dc . sketch ) ;
268
-
269
269
if ( ! this . useArduinoCli ( ) ) {
270
270
args . push ( "--verify" ) ;
271
271
} else {
272
272
args . push ( "compile" , "-b" , boardDescriptor ) ;
273
273
}
274
274
275
- args . push ( appPath ) ;
276
275
const verbose = VscodeSettings . getInstance ( ) . logLevel === "verbose" ;
277
276
if ( verbose ) {
278
277
args . push ( "--verbose" ) ;
@@ -303,6 +302,9 @@ export class ArduinoApp {
303
302
let success = false ;
304
303
const compilerParserContext = makeCompilerParserContext ( dc ) ;
305
304
305
+ // Push sketch as last argument
306
+ args . push ( path . join ( ArduinoWorkspace . rootPath , dc . sketch ) ) ;
307
+
306
308
const cleanup = async ( ) => {
307
309
await Promise . resolve ( ) ;
308
310
}
0 commit comments