浏览代码

allow relative dirs for haxelib setup + less verbose

Nicolas Cannasse 13 年之前
父节点
当前提交
5fcefde021
共有 1 个文件被更改,包括 5 次插入2 次删除
  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);
 		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");
 			if( line != "" )
 				rep = line;
@@ -593,6 +595,7 @@ class Main {
 					Sys.exit(1);
 				}
 			}
+			rep = try sys.FileSystem.fullPath(rep) catch( e : Dynamic ) rep;
 			sys.io.File.saveContent(config_file, rep);
 		} else if( !sys.FileSystem.exists(rep) )
 			throw "haxelib Repository "+rep+" does not exists. Please run haxelib setup again";