]> source.dussan.org Git - jquery-ui.git/commitdiff
Build/grunt: Switch to adm-zip. Use addFile method until addLocalFile is implemented.
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Tue, 6 Mar 2012 17:18:09 +0000 (18:18 +0100)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Tue, 6 Mar 2012 17:18:09 +0000 (18:18 +0100)
grunt.js
package.json

index 2a79ff2267417ade88778416b71702dbbd6345d8..ab8d57f31bfcf21b8cb1f6b932f6f7f725248b3c 100644 (file)
--- a/grunt.js
+++ b/grunt.js
@@ -75,29 +75,15 @@ task.registerBasicTask('zip', 'Create a zip file for release', function(data) {
   var files = file.expand(data.src);
   log.writeln("Creating zip file " + data.dest);
 
-  var done = this.async();
-
-  var zipstream = require('zipstream');
   var fs = require('fs');
-
-  var out = fs.createWriteStream(data.dest);
-  var zip = zipstream.createZip({ level: 1 });
-
-  zip.pipe(out);
-
-  function addFile() {
-    if (!files.length) {
-      zip.finalize(function(written) {
-        log.writeln(written + ' total bytes written');
-        done();
-      });
-      return;
-    }
-    var file = files.shift();
+  var AdmZip = require('adm-zip');
+  var zip = new AdmZip();
+  files.forEach(function(file) {
     log.verbose.writeln('Zipping ' + file);
-    zip.addFile(fs.createReadStream(file), { name: file }, addFile);
-  }
-  addFile();
+    zip.addFile(file, fs.readFileSync(file));
+  });
+  zip.writeZip(data.dest);
+  log.writeln("Wrote " + files.length + " files to " + data.dest);
 });
 
 task.registerTask('default', 'lint qunit');
index f1bbdf69dc32995924981ed5ae41b246c7c4e177..9745bda44775aa397bac0667848051a48e0d1397 100644 (file)
@@ -27,7 +27,7 @@
   "dependencies": {},
   "devDependencies": {
     "grunt": "0.2.x",
-    "zipstream": "0.2.x"
+    "adm-zip": "0.1.x"
   },
   "keywords": []
 }
\ No newline at end of file