]> source.dussan.org Git - jquery.git/commitdiff
Release: Instantiate a zip archiver, run archivers async
authorTimmy Willison <timmywillisn@gmail.com>
Thu, 23 Jan 2014 20:45:23 +0000 (15:45 -0500)
committerTimmy Willison <timmywillisn@gmail.com>
Thu, 23 Jan 2014 21:00:54 +0000 (16:00 -0500)
build/release.js

index ab4b908f8d71c59cb3da24fe25e58f219008268f..e7da799882ffd65ae3da8c63a28d00c5c98747fd 100644 (file)
@@ -74,15 +74,15 @@ module.exports = function( Release ) {
                });
        }
 
-       function buildGoogleCDN( next ) {
-               makeArchive( "googlecdn", googleFilesCDN, next );
+       function buildGoogleCDN() {
+               makeArchive( "googlecdn", googleFilesCDN );
        }
 
-       function buildMicrosoftCDN( next ) {
-               makeArchive( "mscdn", msFilesCDN, next );
+       function buildMicrosoftCDN() {
+               makeArchive( "mscdn", msFilesCDN );
        }
 
-       function makeArchive( cdn, files, next ) {
+       function makeArchive( cdn, files ) {
                if ( Release.preRelease ) {
                        console.log( "Skipping archive creation for " + cdn + "; this is a beta release." );
                        return;
@@ -90,7 +90,7 @@ module.exports = function( Release ) {
 
                console.log( "Creating production archive for " + cdn );
 
-               var archiver = require( "archiver" ),
+               var archiver = require( "archiver" )( "zip" ),
                        md5file = cdnFolder + "/" + cdn + "-md5.txt",
                        output = fs.createWriteStream( cdnFolder + "/" + cdn + "-jquery-" + Release.newVersion + ".zip" );
 
@@ -98,7 +98,6 @@ module.exports = function( Release ) {
                        throw err;
                });
 
-               output.on( "close", next );
                archiver.pipe( output );
 
                files = files.map(function( item ) {
@@ -138,8 +137,10 @@ module.exports = function( Release ) {
                 * Release completion
                 */
                complete: function() {
-                       // Build CDN archives
-                       Release._walk([ buildGoogleCDN, buildMicrosoftCDN, _complete ]);
+                       // Build CDN archives async
+                       buildGoogleCDN();
+                       buildMicrosoftCDN();
+                       _complete();
                },
                /**
                 * Our trac milestones are different than the new version