diff --git a/tools/CommandLineTools.hx b/tools/CommandLineTools.hx index 17cb11eab..3a2b1c3ba 100644 --- a/tools/CommandLineTools.hx +++ b/tools/CommandLineTools.hx @@ -512,68 +512,39 @@ class CommandLineTools { if (FileSystem.exists ("tools.n")) { - path = PathHelper.combine (Sys.getCwd (), "../"); + path = PathHelper.combine (Sys.getCwd (), "../ndll/"); } else if (FileSystem.exists ("run.n")) { - path = Sys.getCwd (); + path = Sys.getCwd () + "/ndll/"; } if (path == "") { var process = new Process ("haxelib", [ "path", "lime" ]); - var lines = new Array (); try { while (true) { - var length = lines.length; var line = StringTools.trim (process.stdout.readLine ()); - - if (length > 0 && (line == "-D lime" || StringTools.startsWith (line, "-D lime="))) { + trace (line); + if (StringTools.startsWith (line, "-L ")) { - path = StringTools.trim (lines[length - 1]); - - } - - lines.push (line); - - } - - } catch (e:Dynamic) { - - } - - if (path == "") { - - for (line in lines) { - - if (line != "" && line.substr (0, 1) != "-") { - - try { - - if (FileSystem.exists (line)) { - - path = line; - - } - - } catch (e:Dynamic) {} + path = StringTools.trim (line.substr (2)); + break; } } - } + } catch (e:Dynamic) {} process.close (); } - path += "../ndll/"; - switch (PlatformHelper.hostPlatform) { case WINDOWS: diff --git a/tools/SVGExport.hx b/tools/SVGExport.hx index 9192bb28b..3e0b611a1 100644 --- a/tools/SVGExport.hx +++ b/tools/SVGExport.hx @@ -26,36 +26,39 @@ class SVGExport { var haxePath = Sys.getEnv ("HAXEPATH"); var command = (haxePath != null && haxePath != "") ? haxePath + "/haxelib" : "haxelib"; - var process = new Process (command, [ "path", "lime" ]); var path = ""; - try { + if (FileSystem.exists ("svg.n")) { - var lines = new Array (); + path = PathHelper.combine (Sys.getCwd (), "../ndll/"); - while (true) { + } + + if (path == "") { + + var process = new Process ("haxelib", [ "path", "lime" ]); + + try { - var length = lines.length; - var line = StringTools.trim (process.stdout.readLine ()); - - if (length > 0 && (line == "-D lime" || StringTools.startsWith (line, "-D lime="))) { + while (true) { - path = StringTools.trim (lines[length - 1]); + var line = StringTools.trim (process.stdout.readLine ()); + trace (line); + if (StringTools.startsWith (line, "-L ")) { + + path = StringTools.trim (line.substr (2)); + break; + + } } - lines.push (line); - - } - - } catch (e:Dynamic) { + } catch (e:Dynamic) {} process.close (); } - path += "../ndll/"; - switch (PlatformHelper.hostPlatform) { case WINDOWS: