Allow custom haxelib path during 'rebuild', such as --haxelib-lime=~/path/to/lime

This commit is contained in:
Joshua Granick
2014-05-26 09:25:32 -07:00
parent 1675043dd1
commit e0f6074310
2 changed files with 20 additions and 2 deletions

BIN
run.n vendored

Binary file not shown.

View File

@@ -1009,8 +1009,6 @@ class RunScript {
public static function main () {
limeDirectory = PathHelper.getHaxelib (new Haxelib ("lime"), true);
if (new EReg ("window", "i").match (Sys.systemName ())) {
isLinux = false;
@@ -1062,11 +1060,27 @@ class RunScript {
for (arg in args) {
var equals = arg.indexOf ("=");
if (StringTools.startsWith (arg, "-D")) {
defines.push (arg);
ignoreLength++;
} else if (equals > -1 && StringTools.startsWith (arg, "--")) {
var argValue = arg.substr (equals + 1);
var field = arg.substr (2, equals - 2);
if (StringTools.startsWith (field, "haxelib-")) {
var name = field.substr (8);
PathHelper.haxelibOverrides.set (name, PathHelper.tryFullPath (argValue));
}
ignoreLength++;
} else if (StringTools.startsWith (arg, "-")) {
switch (arg) {
@@ -1092,6 +1106,8 @@ class RunScript {
}
limeDirectory = PathHelper.getHaxelib (new Haxelib ("lime"), true);
var path = "";
if (args.length == 2 + ignoreLength) {
@@ -1182,6 +1198,8 @@ class RunScript {
} else {
limeDirectory = PathHelper.getHaxelib (new Haxelib ("lime"), true);
if (command == "setup") {
var toolsDirectory = PathHelper.getHaxelib (new Haxelib ("lime-tools"));