Skip to content

Commit

Permalink
made global attribute functional
Browse files Browse the repository at this point in the history
  • Loading branch information
Frakits authored Jul 1, 2023
1 parent 2aa4329 commit 5d10527
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions commandline/commands/Update.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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}"');
}
Expand Down Expand Up @@ -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;
}
}

0 comments on commit 5d10527

Please sign in to comment.