@@ -26,6 +26,7 @@ public class ExportedSketch implements RunnableSketch {
2626 public static final String ARGS_EXPORTED = "--exported" ;
2727
2828 private final File sketchPath ;
29+ private final File sketchHome ;
2930 private final String code ;
3031 private final DisplayType displayType ;
3132 private final String backgroundColor ;
@@ -39,6 +40,7 @@ public class ExportedSketch implements RunnableSketch {
3940 public ExportedSketch (final String [] args ) throws Exception {
4041 // The last argument is the path to the sketch
4142 this .sketchPath = new File (args [args .length - 1 ]).getAbsoluteFile ();
43+ this .sketchHome = sketchPath .getParentFile ().getParentFile ();
4244
4345 if (!sketchPath .exists ()) {
4446 throw new FileNotFoundException ("Something is terribly wrong - I can't find your sketch!" );
@@ -97,7 +99,7 @@ public String getMainCode() {
9799
98100 @ Override
99101 public File getHomeDirectory () {
100- return sketchPath . getParentFile (). getParentFile () ;
102+ return sketchHome ;
101103 }
102104
103105 @ Override
@@ -137,4 +139,15 @@ public boolean shouldRun() {
137139 return true ;
138140 }
139141
142+ @ Override
143+ public List <File > getPathEntries () {
144+ final List <File > entries = new ArrayList <>();
145+
146+ entries .add (sketchHome );
147+ entries .add (new File (sketchHome , "source" ));
148+ entries .add (new File (sketchHome , "lib" ));
149+
150+ return entries ;
151+ }
152+
140153}
0 commit comments