Nicolas Cannasse 18 年之前
父节点
当前提交
d39309718e
共有 1 个文件被更改,包括 19 次插入1 次删除
  1. 19 1
      doc/Installer.hx

+ 19 - 1
doc/Installer.hx

@@ -171,10 +171,28 @@ class Installer {
 		f.close();
 	}
 
+	function unzip( file ) {
+		var ch = neko.io.File.read(file,true);
+		if( neko.io.Path.extension(file) == "zip" ) {
+			var entries = neko.zip.File.read(ch).map(function(z) {
+				return {
+					file : z.fileName,
+					data : function() { return neko.zip.File.unzip(z); }
+				};
+			});
+			ch.close();
+			return entries;
+		}
+		throw "TGZ not supported";
+		return null;
+	}
+
 	function installNeko( file ) {
+		var data = unzip(file);
 	}
 
 	function installHaxe( file) {
+		var data = unzip(file);
 	}
 
 	static function main() {
@@ -221,4 +239,4 @@ class Progress extends neko.io.Output {
 		max = m;
 	}
 
-}
+}