@@ -138,15 +138,6 @@ export class ArduinoApp {
138
138
return ;
139
139
}
140
140
141
- arduinoChannel . show ( ) ;
142
- arduinoChannel . start ( `Upload sketch - ${ dc . sketch } ` ) ;
143
-
144
- await vscode . workspace . saveAll ( false ) ;
145
-
146
- if ( ! await this . runPreBuildCommand ( dc ) ) {
147
- return ;
148
- }
149
-
150
141
if ( ! compile && ! this . useArduinoCli ( ) ) {
151
142
arduinoChannel . error ( "This command is only availble when using the Arduino CLI" ) ;
152
143
return ;
@@ -176,14 +167,20 @@ export class ArduinoApp {
176
167
args . push ( "--port" , dc . port ) ;
177
168
}
178
169
179
- if ( ! await this . runPreBuildCommand ( dc ) ) {
180
- return ;
181
- }
182
-
183
170
const verbose = VscodeSettings . getInstance ( ) . logLevel === "verbose" ;
184
171
if ( verbose ) {
185
172
args . push ( "--verbose" ) ;
186
173
}
174
+
175
+ await vscode . workspace . saveAll ( false ) ;
176
+
177
+ arduinoChannel . show ( ) ;
178
+ arduinoChannel . start ( `Upload sketch - ${ dc . sketch } ` ) ;
179
+
180
+ if ( ! await this . runPreBuildCommand ( dc ) ) {
181
+ return ;
182
+ }
183
+
187
184
if ( dc . output && compile ) {
188
185
const outputPath = path . resolve ( ArduinoWorkspace . rootPath , dc . output ) ;
189
186
const dirPath = path . dirname ( outputPath ) ;
@@ -258,14 +255,6 @@ export class ArduinoApp {
258
255
await this . getMainSketch ( dc ) ;
259
256
}
260
257
261
- await vscode . workspace . saveAll ( false ) ;
262
-
263
- arduinoChannel . start ( `Verify sketch - ${ dc . sketch } ` ) ;
264
-
265
- if ( ! await this . runPreBuildCommand ( dc ) ) {
266
- return false ;
267
- }
268
-
269
258
if ( ! this . useArduinoCli ( ) ) {
270
259
args . push ( "--verify" ) ;
271
260
} else {
@@ -276,6 +265,16 @@ export class ArduinoApp {
276
265
if ( verbose ) {
277
266
args . push ( "--verbose" ) ;
278
267
}
268
+
269
+ await vscode . workspace . saveAll ( false ) ;
270
+
271
+ arduinoChannel . show ( ) ;
272
+ arduinoChannel . start ( `Verify sketch - ${ dc . sketch } ` ) ;
273
+
274
+ if ( ! await this . runPreBuildCommand ( dc ) ) {
275
+ return false ;
276
+ }
277
+
279
278
if ( output || dc . output ) {
280
279
const outputPath = path . resolve ( ArduinoWorkspace . rootPath , output || dc . output ) ;
281
280
const dirPath = path . dirname ( outputPath ) ;
@@ -297,8 +296,6 @@ export class ArduinoApp {
297
296
arduinoChannel . warning ( msg ) ;
298
297
}
299
298
300
- arduinoChannel . show ( ) ;
301
-
302
299
let success = false ;
303
300
const compilerParserContext = makeCompilerParserContext ( dc ) ;
304
301
0 commit comments