make libPath part of Prelude
This commit is contained in:
@@ -76,7 +76,7 @@ class CompilerTools {
|
||||
var classPathFolders = classPath.split("/");
|
||||
while (classPathFolders.length > 0) {
|
||||
try {
|
||||
Helpers.libPath(classPathFolders[classPathFolders.length - 1]);
|
||||
Prelude.libPath(classPathFolders[classPathFolders.length - 1]);
|
||||
break;
|
||||
} catch (e) {
|
||||
classPathFolders.pop();
|
||||
@@ -116,7 +116,7 @@ class CompilerTools {
|
||||
mainHxFile = args.mainHxFile;
|
||||
copyToFolder(mainHxFile);
|
||||
} else {
|
||||
copyToFolder(mainHxFile, Path.join([Helpers.libPath("kiss"), "src", "kiss"]));
|
||||
copyToFolder(mainHxFile, Path.join([Prelude.libPath("kiss"), "src", "kiss"]));
|
||||
}
|
||||
|
||||
var mainClassName = mainHxFile.withoutDirectory().withoutExtension();
|
||||
|
@@ -561,9 +561,4 @@ class Helpers {
|
||||
throw CompileError.fromExp(exp, '$forThis bindings should be a list expression with an even number of sub expressions (at least 2)');
|
||||
};
|
||||
}
|
||||
|
||||
// Get the path to a haxelib the user has installed
|
||||
public static function libPath(haxelibName:String) {
|
||||
return Prelude.assertProcess("haxelib", ["libpath", haxelibName]).trim();
|
||||
}
|
||||
}
|
||||
|
@@ -76,6 +76,7 @@ class Kiss {
|
||||
"count" => Symbol("Lambda.count"),
|
||||
"enumerate" => Symbol("Prelude.enumerate"),
|
||||
"assertProcess" => Symbol("Prelude.assertProcess"),
|
||||
"libPath" => Symbol("Prelude.libPath"),
|
||||
"random" => Symbol("Std.random"),
|
||||
"walkDirectory" => Symbol("Prelude.walkDirectory"),
|
||||
"purgeDirectory" => Symbol("Prelude.purgeDirectory"),
|
||||
|
@@ -49,7 +49,7 @@ class Macros {
|
||||
|
||||
var libPath = switch (args[0].def) {
|
||||
case StrExp(libName):
|
||||
Helpers.libPath(libName);
|
||||
Prelude.libPath(libName);
|
||||
default:
|
||||
throw CompileError.fromExp(args[0], "first argument to loadFrom should be a string literal of a haxe library's name");
|
||||
};
|
||||
|
@@ -581,6 +581,11 @@ class Prelude {
|
||||
#end
|
||||
}
|
||||
|
||||
// Get the path to a haxelib the user has installed
|
||||
public static function libPath(haxelibName:String) {
|
||||
return assertProcess("haxelib", ["libpath", haxelibName]).trim();
|
||||
}
|
||||
|
||||
public static function filter<T>(l:Iterable<T>, ?p:(T) -> Bool):kiss.List<T> {
|
||||
if (p == null)
|
||||
p = Prelude.truthy;
|
||||
|
Reference in New Issue
Block a user