mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-22 08:22:04 +03:00
IDE command line: sketches can now be specified with relative paths. Fixes #1493
This commit is contained in:
@ -324,6 +324,7 @@ public class Base {
|
||||
boolean doVerbose = false;
|
||||
String selectBoard = null;
|
||||
String selectPort = null;
|
||||
String currentDirectory = System.getProperty("user.dir");
|
||||
// Check if any files were passed in on the command line
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
if (args[i].equals("--upload")) {
|
||||
@ -350,6 +351,12 @@ public class Base {
|
||||
selectPort = args[i];
|
||||
continue;
|
||||
}
|
||||
if (args[i].equals("--curdir")) {
|
||||
i++;
|
||||
if (i < args.length)
|
||||
currentDirectory = args[i];
|
||||
continue;
|
||||
}
|
||||
String path = args[i];
|
||||
// Fix a problem with systems that use a non-ASCII languages. Paths are
|
||||
// being passed in with 8.3 syntax, which makes the sketch loader code
|
||||
@ -363,6 +370,9 @@ public class Base {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (!new File(path).exists()) {
|
||||
path = new File(currentDirectory, path).getAbsolutePath();
|
||||
}
|
||||
if (handleOpen(path) != null) {
|
||||
opened = true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user