From 43c0deddb736fbed072fead65fb082410917506c Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Mon, 22 May 2017 09:23:33 -0700 Subject: [PATCH] Fix version mismatch, fix null check --- lime/project/HXProject.hx | 2 +- lime/tools/helpers/HaxelibHelper.hx | 12 ++++++++++++ tools/haxelib/client/Main.hx | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lime/project/HXProject.hx b/lime/project/HXProject.hx index fa7968927..55f9943b1 100644 --- a/lime/project/HXProject.hx +++ b/lime/project/HXProject.hx @@ -1116,7 +1116,7 @@ class HXProject { var name = haxelib.name; var version = HaxelibHelper.getVersion (haxelib); - if (haxelib.version != null) { + if (version != null) { name += ":" + version; diff --git a/lime/tools/helpers/HaxelibHelper.hx b/lime/tools/helpers/HaxelibHelper.hx index 64b1e2a76..23a51396d 100644 --- a/lime/tools/helpers/HaxelibHelper.hx +++ b/lime/tools/helpers/HaxelibHelper.hx @@ -242,6 +242,18 @@ class HaxelibHelper { LogHelper.error ("Could not find haxelib \"" + dependencyName + "\" (dependency of \"" + haxelib.name + "\"), does it need to be installed?"); + } else if (output.indexOf ("is not installed") > -1) { + + var start = output.indexOf ("Library " + 8); + var end = output.indexOf (" ", start); + var dependencyName = output.substring (start, end); + + start = output.indexOf ("version ") + 8; + end = output.indexOf (" ", start); + var version = output.substring (start, end); + + LogHelper.error ("Could not find haxelib \"" + dependencyName + "\" version \"" + version + "\", does it need to be installed?"); + } else { if (haxelib.version != "") { diff --git a/tools/haxelib/client/Main.hx b/tools/haxelib/client/Main.hx index 96285ad22..3ceaa7616 100644 --- a/tools/haxelib/client/Main.hx +++ b/tools/haxelib/client/Main.hx @@ -1290,7 +1290,7 @@ class Main { var dev = try getDev(pdir) catch (_:Dynamic) null; var vdir = try getVersionDir(version,dev,pdir) catch (_:Dynamic) null; - if( vdir != null && !FileSystem.exists(vdir) ) + if( vdir == null || !FileSystem.exists(vdir) ) throw "Library "+prj+" version "+version+" is not installed"; for( p in l )