@@ -115,15 +115,15 @@ export class ArduinoApp {
115
115
let restoreSerialMonitor : boolean = false ;
116
116
const boardDescriptor = this . getBoardBuildString ( ) ;
117
117
if ( ! boardDescriptor ) {
118
- return ;
118
+ return false ;
119
119
}
120
120
if ( ! this . useArduinoCli ( ) ) {
121
121
args . push ( "--board" , boardDescriptor ) ;
122
122
}
123
123
124
124
if ( ! ArduinoWorkspace . rootPath ) {
125
125
vscode . window . showWarningMessage ( "Cannot find the sketch file." ) ;
126
- return ;
126
+ return false ;
127
127
}
128
128
129
129
if ( ! dc . sketch || ! util . fileExistsSync ( path . join ( ArduinoWorkspace . rootPath , dc . sketch ) ) ) {
@@ -142,12 +142,12 @@ export class ArduinoApp {
142
142
if ( buildMode === BuildMode . Upload ) {
143
143
if ( ( ! dc . configuration || ! / u p l o a d _ m e t h o d = [ ^ = , ] * s t [ ^ , ] * l i n k / i. test ( dc . configuration ) ) && ! dc . port ) {
144
144
await selectSerial ( ) ;
145
- return ;
145
+ return false ;
146
146
}
147
147
148
148
if ( ! compile && ! this . useArduinoCli ( ) ) {
149
149
arduinoChannel . error ( "This command is only available when using the Arduino CLI" ) ;
150
- return ;
150
+ return false ;
151
151
}
152
152
153
153
if ( ! this . useArduinoCli ( ) ) {
@@ -168,16 +168,16 @@ export class ArduinoApp {
168
168
} else if ( buildMode === BuildMode . UploadProgrammer ) {
169
169
const programmer = this . getProgrammerString ( ) ;
170
170
if ( ! programmer ) {
171
- return ;
171
+ return false ;
172
172
}
173
173
if ( ! dc . port ) {
174
174
await selectSerial ( ) ;
175
- return ;
175
+ return false ;
176
176
}
177
177
178
178
if ( ! compile && ! this . useArduinoCli ( ) ) {
179
179
arduinoChannel . error ( "This command is only available when using the Arduino CLI" ) ;
180
- return ;
180
+ return false ;
181
181
}
182
182
183
183
if ( ! this . useArduinoCli ( ) ) {
@@ -212,15 +212,15 @@ export class ArduinoApp {
212
212
arduinoChannel . start ( `${ buildMode } sketch '${ dc . sketch } '` ) ;
213
213
214
214
if ( ! await this . runPreBuildCommand ( dc ) ) {
215
- return ;
215
+ return false ;
216
216
}
217
217
218
218
if ( dc . output && compile ) {
219
219
const outputPath = path . resolve ( ArduinoWorkspace . rootPath , dc . output ) ;
220
220
const dirPath = path . dirname ( outputPath ) ;
221
221
if ( ! util . directoryExistsSync ( dirPath ) ) {
222
222
logger . notifyUserError ( "InvalidOutPutPath" , new Error ( constants . messages . INVALID_OUTPUT_PATH + outputPath ) ) ;
223
- return ;
223
+ return false ;
224
224
}
225
225
226
226
if ( this . useArduinoCli ( ) ) {
@@ -243,6 +243,8 @@ export class ArduinoApp {
243
243
UsbDetector . getInstance ( ) . pauseListening ( ) ;
244
244
}
245
245
246
+ let success = false ;
247
+
246
248
// Push sketch as last argument
247
249
args . push ( path . join ( ArduinoWorkspace . rootPath , dc . sketch ) ) ;
248
250
@@ -270,6 +272,7 @@ export class ArduinoApp {
270
272
) . then ( async ( ) => {
271
273
await cleanup ( ) ;
272
274
arduinoChannel . end ( `${ buildMode } sketch '${ dc . sketch } '${ os . EOL } ` ) ;
275
+ success = true ;
273
276
} , async ( reason ) => {
274
277
await cleanup ( ) ;
275
278
const msg = reason . code ?
@@ -279,6 +282,7 @@ export class ArduinoApp {
279
282
JSON . stringify ( reason ) ;
280
283
arduinoChannel . error ( `${ buildMode } sketch '${ dc . sketch } ': ${ msg } ${ os . EOL } ` ) ;
281
284
} ) ;
285
+ return success ;
282
286
}
283
287
284
288
public async verify ( buildMode : BuildMode , buildDir : string = "" ) {
0 commit comments