Add error if haxelib repository path is not valid, handle setenv null as empty string to fix crash

This commit is contained in:
Joshua Granick
2017-08-18 14:08:07 -07:00
parent acdc41292f
commit 6103a0a34f

View File

@@ -951,6 +951,8 @@ class HXProject {
public function setenv (name:String, value:String):Void {
if (value == null) value = "";
if (name == "HAXELIB_PATH") {
var currentPath = HaxelibHelper.getRepositoryPath ();
@@ -959,7 +961,17 @@ class HXProject {
if (currentPath != newPath) {
needRerun = true;
var valid = try { (newPath != null && newPath != "" && FileSystem.exists (FileSystem.fullPath (newPath))); } catch (e:Dynamic) { false; }
if (!valid) {
LogHelper.error ("The specified haxelib repository path \"" + value + "\" does not exist");
} else {
needRerun = true;
}
}