1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-12-18 10:22:18 +03:00

Some CLI args are parsed before initializing packages. --board argument is parsed after. Fixes #3261

This commit is contained in:
Federico Fissore
2015-06-05 17:18:50 +02:00
parent 455fecff13
commit 84d10a8ea0
3 changed files with 37 additions and 22 deletions

View File

@@ -427,6 +427,9 @@ public class BaseNoGui {
}
static public void init(String[] args) throws Exception {
CommandlineParser parser = new CommandlineParser(args);
parser.parseArgumentsPhase1();
String sketchbookPath = getSketchbookPath();
// If no path is set, get the default sketchbook folder for this platform
@@ -436,13 +439,13 @@ public class BaseNoGui {
else
showError(_("No sketchbook"), _("Sketchbook path not defined"), null);
}
BaseNoGui.initPackages();
// Setup board-dependent variables.
onBoardOrPortChange();
CommandlineParser parser = CommandlineParser.newCommandlineParser(args);
parser.parseArgumentsPhase2();
for (String path: parser.getFilenames()) {
// Correctly resolve relative paths