Explorar o código

do not overwrite haxelib.xml if it exists in the repository

Simon Krajewski %!s(int64=13) %!d(string=hai) anos
pai
achega
ceb383fcb4
Modificáronse 1 ficheiros con 10 adicións e 6 borrados
  1. 10 6
      std/tools/haxelib/Main.hx

+ 10 - 6
std/tools/haxelib/Main.hx

@@ -592,6 +592,7 @@ class Main {
 				var oldCwd = Sys.getCwd();
 				var oldCwd = Sys.getCwd();
 				Sys.setCwd(rep + "/" + p + "/git");
 				Sys.setCwd(rep + "/" + p + "/git");
 				Sys.command("git pull");
 				Sys.command("git pull");
+				// TODO: update haxelib.xml version?
 				Sys.setCwd(oldCwd);
 				Sys.setCwd(oldCwd);
 			}
 			}
 			else
 			else
@@ -789,12 +790,15 @@ class Main {
 		}
 		}
 		var revision = command("git", ["rev-parse", "HEAD"]).out;
 		var revision = command("git", ["rev-parse", "HEAD"]).out;
 		
 		
-		var devPath = libPath + (subDir == null ? "" : "/" + subDir);		
-		var haxelib = "<project name='" +libName + "' url='" +gitPath + "' license='BSD'>"
-			+"<description></description>"
-			+"<version name='" +revision + "'>Updated from git.</version>"
-			+"</project>";
-		sys.io.File.saveContent(devPath +"/haxelib.xml", haxelib);
+		var devPath = libPath + (subDir == null ? "" : "/" + subDir);
+		if (!sys.FileSystem.exists(devPath +"/haxelib.xml"))
+		{
+			var haxelib = "<project name='" +libName + "' url='" +gitPath + "' license='BSD'>"
+				+"<description></description>"
+				+"<version name='" +revision + "'>Updated from git.</version>"
+				+"</project>";
+			sys.io.File.saveContent(devPath +"/haxelib.xml", haxelib);
+		}
 		
 		
 		Sys.setCwd(libPath + "/../");
 		Sys.setCwd(libPath + "/../");
 		sys.io.File.saveContent(".current", "dev");
 		sys.io.File.saveContent(".current", "dev");