Fix for bug #11 - on windows, autoload of js scripts not working.
This commit is contained in:
parent
75d8299a83
commit
f02aa891c3
2 changed files with 12 additions and 1 deletions
|
@ -27,7 +27,18 @@ public class ScriptCraftPlugin extends JavaPlugin
|
|||
if (jsPlugins.exists()){
|
||||
File[] files = jsPlugins.listFiles();
|
||||
for (File f: files){
|
||||
this.evaluator.eval("load(\"" + f.getAbsolutePath() + "\")", null);
|
||||
String canonicalPath = null;
|
||||
try {
|
||||
//
|
||||
// fix for bug #11
|
||||
//
|
||||
canonicalPath = f.getCanonicalPath();
|
||||
canonicalPath.replaceAll("\\\\", "/");
|
||||
this.evaluator.eval("load(\"" + canonicalPath + "\")", null);
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
Reference in a new issue