Просмотр исходного кода

explicit error message when failed to create repository

Nicolas Cannasse 18 лет назад
Родитель
Сommit
69497214e1
2 измененных файлов с 12 добавлено и 2 удалено
  1. 4 0
      Makefile
  2. 8 2
      std/tools/haxelib/Main.hx

+ 4 - 0
Makefile

@@ -10,6 +10,10 @@ all:
 	ocamlc -c $(EXTC)/extc_stubs.c
 	ocamake $(FLAGS) $(FILES) $(LIBS)
 
+tools:
+	(cd std/tools/haxedoc && haxe haxedoc.hxml && cp haxedoc ../../..)
+	(cd std/tools/haxelib && haxe haxelib.hxml && cp haxelib ../../..) 
+
 clean:
 	ocamake $(FLAGS) -clean $(FILES) $(LIBS)
 	rm -rf extc_stubs.o

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

@@ -483,8 +483,14 @@ class Main {
 			var line = param("Path");
 			if( line != "" )
 				rep = line;
-			if( !neko.FileSystem.exists(rep) )
-				neko.FileSystem.createDirectory(rep);
+			if( !neko.FileSystem.exists(rep) ) {
+				try {
+					neko.FileSystem.createDirectory(rep);
+				} catch( e : Dynamic ) {
+					print("Failed to create directory '"+rep+"' ("+Std.string(e)+"), maybe you need appropriate user rights");
+					neko.Sys.exit(1);
+				}
+			}
 			var f = neko.io.File.write(config,true);
 			f.write(rep);
 			f.close();