diff --git a/run.n b/run.n index 9d5147339..4dad8a78b 100644 Binary files a/run.n and b/run.n differ diff --git a/src/haxelib/Data.hx b/src/haxelib/Data.hx index 2f4e2273d..ee922f61c 100644 --- a/src/haxelib/Data.hx +++ b/src/haxelib/Data.hx @@ -21,6 +21,7 @@ */ package haxelib; +import haxe.CallStack; import haxe.ds.Option; import haxe.ds.*; import haxe.zip.Reader; @@ -63,27 +64,30 @@ abstract DependencyVersion(String) to String from SemVer { @:to function toValidatable():Validatable return - if (this == '') { validate: function () return None } - else @:privateAccess new SemVer(this); + if (this == '' || this == 'git' || (Std.is(this, String) && this.startsWith('git:'))) + { validate: function () return None } + else + @:privateAccess new SemVer(this); static public function isValid(s:String) return new DependencyVersion(s).toValidatable().validate() == None; static public var DEFAULT(default, null) = new DependencyVersion(''); + static public var GIT(default, null) = new DependencyVersion('git'); } abstract Dependencies(Dynamic) from Dynamic { @:to public function toArray():Array { var fields = Reflect.fields(this); fields.sort(Reflect.compare); - + var result:Array = new Array(); - + for (f in fields) { var value:String = Reflect.field(this, f); - var isGit = value != null && (value + "").startsWith("git:"); - + var isGit = value != null && (value + "").startsWith("git:"); + if ( !isGit ) { result.push ({ @@ -101,7 +105,7 @@ abstract Dependencies(Dynamic) from Dynamic 1 ? urlParts[1] : null; - + result.push ({ name: f, type: (DependencyType.Git : DependencyType), @@ -111,10 +115,10 @@ abstract Dependencies(Dynamic) from Dynamic