This repository was archived by the owner on Dec 22, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -141,7 +141,14 @@ export class ArduinoApp {
141
141
}
142
142
if ( dc . output ) {
143
143
const outputPath = path . resolve ( ArduinoWorkspace . rootPath , dc . output ) ;
144
+ const dirPath = path . dirname ( outputPath ) ;
145
+ if ( ! util . directoryExistsSync ( dirPath ) ) {
146
+ Logger . notifyUserError ( "InvalidOutPutPath" , new Error ( constants . messages . INVALID_OUTPUT_PATH + outputPath ) ) ;
147
+ return ;
148
+ }
149
+
144
150
args . push ( "--pref" , `build.path=${ outputPath } ` ) ;
151
+ arduinoChannel . info ( `Please see the build logs in Output path: ${ outputPath } ` ) ;
145
152
} else {
146
153
const msg = "Output path is not specified. Unable to reuse previously compiled files. Upload could be slow. See README." ;
147
154
arduinoChannel . warning ( msg ) ;
@@ -254,7 +261,14 @@ export class ArduinoApp {
254
261
}
255
262
if ( output || dc . output ) {
256
263
const outputPath = path . resolve ( ArduinoWorkspace . rootPath , output || dc . output ) ;
264
+ const dirPath = path . dirname ( outputPath ) ;
265
+ if ( ! util . directoryExistsSync ( dirPath ) ) {
266
+ Logger . notifyUserError ( "InvalidOutPutPath" , new Error ( constants . messages . INVALID_OUTPUT_PATH + outputPath ) ) ;
267
+ return ;
268
+ }
269
+
257
270
args . push ( "--pref" , `build.path=${ outputPath } ` ) ;
271
+ arduinoChannel . info ( `Please see the build logs in Output path: ${ outputPath } ` ) ;
258
272
} else {
259
273
const msg = "Output path is not specified. Unable to reuse previously compiled files. Verify could be slow. See README." ;
260
274
arduinoChannel . warning ( msg ) ;
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ export const messages = {
29
29
SERIAL_PORT_NOT_STARTED : "Serial Monitor has not been started." ,
30
30
SEND_BEFORE_OPEN_SERIALPORT : "Please open a serial port first." ,
31
31
NO_PROGRAMMMER_SELECTED : "Please select the programmer first." ,
32
+ INVALID_OUTPUT_PATH : "Please check the \"output\" in the sketch Settings.Cannot find the output path:" ,
32
33
} ;
33
34
34
35
export const statusBarPriority = {
You can’t perform that action at this time.
0 commit comments