@@ -65,8 +65,8 @@ public class BaseNoGui {
65
65
VERSION_NAME_LONG = versionNameLong ;
66
66
}
67
67
68
- private static DiscoveryManager discoveryManager = new DiscoveryManager () ;
69
-
68
+ private static DiscoveryManager discoveryManager ;
69
+
70
70
// these are static because they're used by Sketch
71
71
static private File examplesFolder ;
72
72
static private File toolsFolder ;
@@ -446,12 +446,6 @@ static public void init(String[] args) throws Exception {
446
446
447
447
BaseNoGui .initPackages ();
448
448
449
- // refresh the serial port names after loading all packages
450
- BaseNoGui .getDiscoveryManager ().getSerialDiscoverer ().forceRefresh ();
451
-
452
- // Setup board-dependent variables.
453
- onBoardOrPortChange ();
454
-
455
449
parser .parseArgumentsPhase2 ();
456
450
457
451
for (String path : parser .getFilenames ()) {
@@ -481,7 +475,10 @@ static public void init(String[] args) throws Exception {
481
475
showError (null , mess , 2 );
482
476
}
483
477
}
484
-
478
+
479
+ // Setup board-dependent variables.
480
+ onBoardOrPortChange ();
481
+
485
482
// Save the preferences. For GUI mode, this happens in the quit
486
483
// handler, but for other modes we should also make sure to save
487
484
// them.
@@ -608,6 +605,9 @@ static public void initLogger() {
608
605
}
609
606
610
607
static public void initPackages () throws Exception {
608
+
609
+ discoveryManager = new DiscoveryManager ();
610
+
611
611
indexer = new ContributionsIndexer (getSettingsFolder (), getHardwareFolder (), getPlatform (),
612
612
new GPGDetachedSignatureVerifier ());
613
613
0 commit comments