diff --git a/commandline/commands/Update.hx b/commandline/commands/Update.hx index 6404ab35..26eafb91 100644 --- a/commandline/commands/Update.hx +++ b/commandline/commands/Update.hx @@ -20,8 +20,9 @@ class Update { for (libNode in libsXML.elements) { var lib:Library = { name: libNode.att.name, - type: libNode.name + type: libNode.name, }; + if (libNode.has.global) lib.global = libNode.att.global; switch (lib.type) { case "lib": if (libNode.has.version) lib.version = libNode.att.version; @@ -34,16 +35,17 @@ class Update { for(lib in libs) { // install libs + var globalism = lib.global == "true" ? "--global" : ""; switch(lib.type) { case "lib": prettyPrint('Installing "${lib.name}"...'); - Sys.command('haxelib install ${lib.name} ${lib.version != null ? " " + lib.version : " "}'); + Sys.command('haxelib $globalism install ${lib.name} ${lib.version != null ? " " + lib.version : " "}'); case "git": prettyPrint('Installing "${lib.name}" from git url "${lib.url}"'); - if (lib.ref != null) - Sys.command('haxelib git ${lib.name} ${lib.url} ${lib.ref}'); - else - Sys.command('haxelib git ${lib.name} ${lib.url}'); + if (lib.ref != null) + Sys.command('haxelib $globalism git ${lib.name} ${lib.url} ${lib.ref}'); + else + Sys.command('haxelib $globalism git ${lib.name} ${lib.url}'); default: prettyPrint('Cannot resolve library of type "${lib.type}"'); } @@ -90,7 +92,8 @@ class Update { typedef Library = { var name:String; var type:String; + var ?global:String; var ?version:String; var ?ref:String; var ?url:String; -} \ No newline at end of file +}