Browse Source

allow relative dirs for haxelib setup + less verbose

Nicolas Cannasse 13 năm trước cách đây
mục cha
commit
5fcefde021
1 tập tin đã thay đổi với 5 bổ sung2 xóa
  1. 5 2
      std/tools/haxelib/Main.hx

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

@@ -579,8 +579,10 @@ class Main {
 		}
 		}
 		rep = StringTools.trim(rep);
 		rep = StringTools.trim(rep);
 		if( setup ) {
 		if( setup ) {
-			print("Please enter haxelib repository path with write access");
-			print("Hit enter for default (" + rep + ")");
+			if( args.length <= argcur ) {
+				print("Please enter haxelib repository path with write access");
+				print("Hit enter for default (" + rep + ")");
+			}
 			var line = param("Path");
 			var line = param("Path");
 			if( line != "" )
 			if( line != "" )
 				rep = line;
 				rep = line;
@@ -593,6 +595,7 @@ class Main {
 					Sys.exit(1);
 					Sys.exit(1);
 				}
 				}
 			}
 			}
+			rep = try sys.FileSystem.fullPath(rep) catch( e : Dynamic ) rep;
 			sys.io.File.saveContent(config_file, rep);
 			sys.io.File.saveContent(config_file, rep);
 		} else if( !sys.FileSystem.exists(rep) )
 		} else if( !sys.FileSystem.exists(rep) )
 			throw "haxelib Repository "+rep+" does not exists. Please run haxelib setup again";
 			throw "haxelib Repository "+rep+" does not exists. Please run haxelib setup again";