Parcourir la source

use proper git revision check

Simon Krajewski il y a 13 ans
Parent
commit
087e1fa670
1 fichiers modifiés avec 6 ajouts et 5 suppressions
  1. 6 5
      std/tools/haxelib/Main.hx

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

@@ -762,14 +762,15 @@ class Main {
 		var gitPath = param("Git path");
 		var gitPath = param("Git path");
 		var subDir = paramOpt();
 		var subDir = paramOpt();
 		
 		
-		var split = gitPath.split("@");
-		var rev = if (split.length == 2) {
-			gitPath = split[0];
-			split[1];
+		var match = ~/@([0-9]+)/;
+		var rev = if (match.match(gitPath) && match.matchedRight() == "")
+		{
+			gitPath = match.matchedLeft();
+			match.matched(1);
 		}
 		}
 		else
 		else
 			null;
 			null;
-				
+
 		print("Installing " +libName + " from " +gitPath);
 		print("Installing " +libName + " from " +gitPath);
 		var ret = command("git", ["clone", gitPath, libPath]);
 		var ret = command("git", ["clone", gitPath, libPath]);
 		if (ret.code != 0)
 		if (ret.code != 0)