diff --git a/commandline/commands/Update.hx b/commandline/commands/Update.hx index 6404ab35..f829131f 100644 --- a/commandline/commands/Update.hx +++ b/commandline/commands/Update.hx @@ -22,6 +22,7 @@ class Update { name: libNode.att.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 : " "}'); + prettyPrint((lib.global == "true" ? "Globally installing" : "Locally installing") + ' "${lib.name}"...'); + 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}'); + prettyPrint((lib.global == "true" ? "Globally installing" : "Locally installing") + ' "${lib.name}" from git url "${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 +} diff --git a/libs.xml b/libs.xml index 3ee3beeb..f3a63710 100644 --- a/libs.xml +++ b/libs.xml @@ -8,7 +8,9 @@ - + + + @@ -20,4 +22,4 @@ - \ No newline at end of file + diff --git a/project.xml b/project.xml index 327e5bd7..83f5b817 100644 --- a/project.xml +++ b/project.xml @@ -182,7 +182,7 @@ - +