aboutsummaryrefslogtreecommitdiffstats
path: root/grunt.js
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2012-03-06 18:18:09 +0100
committerJörn Zaefferer <joern.zaefferer@gmail.com>2012-03-06 18:18:09 +0100
commit98fc87a5d72472d813b618a333bc2fa23defaaec (patch)
treeceec970137b2412c6e98047d24479f184d0361c9 /grunt.js
parent15eb3ac8f1123fa3075dd7fc6ae738a87c45ca39 (diff)
downloadjquery-ui-98fc87a5d72472d813b618a333bc2fa23defaaec.tar.gz
jquery-ui-98fc87a5d72472d813b618a333bc2fa23defaaec.zip
Build/grunt: Switch to adm-zip. Use addFile method until addLocalFile is implemented.
Diffstat (limited to 'grunt.js')
-rw-r--r--grunt.js28
1 files changed, 7 insertions, 21 deletions
diff --git a/grunt.js b/grunt.js
index 2a79ff226..ab8d57f31 100644
--- 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');