File tree 2 files changed +15
-3
lines changed
2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -324,6 +324,7 @@ public Base(String[] args) throws Exception {
324
324
boolean doVerbose = false ;
325
325
String selectBoard = null ;
326
326
String selectPort = null ;
327
+ String currentDirectory = System .getProperty ("user.dir" );
327
328
// Check if any files were passed in on the command line
328
329
for (int i = 0 ; i < args .length ; i ++) {
329
330
if (args [i ].equals ("--upload" )) {
@@ -350,6 +351,12 @@ public Base(String[] args) throws Exception {
350
351
selectPort = args [i ];
351
352
continue ;
352
353
}
354
+ if (args [i ].equals ("--curdir" )) {
355
+ i ++;
356
+ if (i < args .length )
357
+ currentDirectory = args [i ];
358
+ continue ;
359
+ }
353
360
String path = args [i ];
354
361
// Fix a problem with systems that use a non-ASCII languages. Paths are
355
362
// being passed in with 8.3 syntax, which makes the sketch loader code
@@ -363,6 +370,9 @@ public Base(String[] args) throws Exception {
363
370
e .printStackTrace ();
364
371
}
365
372
}
373
+ if (!new File (path ).exists ()) {
374
+ path = new File (currentDirectory , path ).getAbsolutePath ();
375
+ }
366
376
if (handleOpen (path ) != null ) {
367
377
opened = true ;
368
378
}
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
-
2
+
3
+ CURDIR=` pwd`
3
4
APPDIR=" $( dirname -- " $( readlink -f -- " ${0} " ) " ) "
4
5
5
6
cd " $APPDIR "
6
-
7
+
7
8
for LIB in \
8
9
java/lib/rt.jar \
9
10
java/lib/tools.jar \
@@ -19,4 +20,5 @@ export LD_LIBRARY_PATH
19
20
20
21
export PATH=" ${APPDIR} /java/bin:${PATH} "
21
22
22
- java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel processing.app.Base " $@ "
23
+ java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel processing.app.Base --curdir $CURDIR " $@ "
24
+
You can’t perform that action at this time.
0 commit comments