diff --git a/app/build.xml b/app/build.xml index 31f52adf2..cbab13552 100644 --- a/app/build.xml +++ b/app/build.xml @@ -103,6 +103,7 @@ + diff --git a/arduino-core/src/processing/app/BaseNoGui.java b/arduino-core/src/processing/app/BaseNoGui.java index dd1e3527e..100db6a66 100644 --- a/arduino-core/src/processing/app/BaseNoGui.java +++ b/arduino-core/src/processing/app/BaseNoGui.java @@ -168,10 +168,14 @@ public class BaseNoGui { File path = new File(System.getProperty("user.dir")); if (OSUtils.isMacOS()) { - try { - path = new File(BaseNoGui.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()).getParentFile(); - } catch (URISyntaxException e) { - throw new RuntimeException(e); + if (System.getProperty("WORK_DIR") != null) { + path = new File(System.getProperty("WORK_DIR")); + } else { + try { + path = new File(BaseNoGui.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()).getParentFile(); + } catch (URISyntaxException e) { + throw new RuntimeException(e); + } } }