File tree 2 files changed +8
-1
lines changed
arduino-core/src/processing/app/helpers
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -267,6 +267,8 @@ public Base(String[] args) throws Exception {
267
267
splash .splashText (tr ("Initializing packages..." ));
268
268
BaseNoGui .initPackages ();
269
269
270
+ parser .getUploadPort ().ifPresent (BaseNoGui ::selectSerialPort );
271
+
270
272
splash .splashText (tr ("Preparing boards..." ));
271
273
272
274
if (!isCommandLine ()) {
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ private enum ACTION {
41
41
private String getPref ;
42
42
private String boardToInstall ;
43
43
private String libraryToInstall ;
44
+ private Optional <String > uploadPort = Optional .empty ();
44
45
private final List <String > filenames = new LinkedList <>();
45
46
46
47
public CommandlineParser (String [] args ) {
@@ -141,7 +142,7 @@ public void parseArgumentsPhase1() {
141
142
i ++;
142
143
if (i >= args .length )
143
144
BaseNoGui .showError (null , tr ("Argument required for --port" ), 3 );
144
- BaseNoGui . selectSerialPort (args [i ]);
145
+ uploadPort = Optional . of (args [i ]);
145
146
if (action == ACTION .GUI )
146
147
action = ACTION .NOOP ;
147
148
continue ;
@@ -356,4 +357,8 @@ public String getLibraryToInstall() {
356
357
public boolean isPreserveTempFiles () {
357
358
return preserveTempFiles ;
358
359
}
360
+
361
+ public Optional <String > getUploadPort () {
362
+ return uploadPort ;
363
+ }
359
364
}
You can’t perform that action at this time.
0 commit comments