Add error if haxelib repository path is not valid, handle setenv null as empty string to fix crash
This commit is contained in:
@@ -951,6 +951,8 @@ class HXProject {
|
|||||||
|
|
||||||
public function setenv (name:String, value:String):Void {
|
public function setenv (name:String, value:String):Void {
|
||||||
|
|
||||||
|
if (value == null) value = "";
|
||||||
|
|
||||||
if (name == "HAXELIB_PATH") {
|
if (name == "HAXELIB_PATH") {
|
||||||
|
|
||||||
var currentPath = HaxelibHelper.getRepositoryPath ();
|
var currentPath = HaxelibHelper.getRepositoryPath ();
|
||||||
@@ -959,10 +961,20 @@ class HXProject {
|
|||||||
|
|
||||||
if (currentPath != newPath) {
|
if (currentPath != newPath) {
|
||||||
|
|
||||||
|
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;
|
needRerun = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
Sys.putEnv (name, value);
|
Sys.putEnv (name, value);
|
||||||
|
|||||||
Reference in New Issue
Block a user