瀏覽代碼

[lua] remove previous hererocks environment if it persists between runs

Justin Donaldson 6 年之前
父節點
當前提交
a069f0fb94
共有 1 個文件被更改,包括 9 次插入1 次删除
  1. 9 1
      tests/runci/targets/Lua.hx

+ 9 - 1
tests/runci/targets/Lua.hx

@@ -35,6 +35,12 @@ class Lua {
 	static public function run(args:Array<String>) {
 		getLuaDependencies();
 		var envpath = Sys.getEnv("HOME") + '/lua_env';
+
+		if (FileSystem.exists(envpath)){
+			infoMsg('Previous envpath $envpath detected: deleting it');
+			FileSystem.deleteDirectory(envpath);
+		}
+
 		addToPATH(envpath + '/bin');
 		for (lv in ["-l5.1", "-l5.2", "-l5.3", "-j2.0", "-j2.1" ]){
 			if (systemName == "Mac" && lv.startsWith("-j")) continue;
@@ -50,9 +56,11 @@ class Lua {
 			runCommand("luarocks", ["config", "--lua-libdir"]);
 			runCommand("luarocks", ["config", "--lua-ver"]);
 			runCommand("luarocks", ["config", "--system-config"]);
-			runCommand("luarocks", ["config", "--user-config"], false, true); //can fail when there is no user config
 			runCommand("luarocks", ["config", "--rock-trees"]);
 
+			// Note: don't use a user config
+			// runCommand("luarocks", ["config", "--user-config"], false, true);
+
 			installLib("haxe-deps", "0.0.1-0");
 
 			changeDirectory(unitDir);