Skip to content

Commit

Permalink
Release: Instantiate a zip archiver, run archivers async
Browse files Browse the repository at this point in the history
  • Loading branch information
timmywil committed Jan 23, 2014
1 parent a204942 commit de7702a
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions build/release.js
Expand Up @@ -74,31 +74,30 @@ 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;
}

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" );

output.on( "error", function( err ) {
throw err;
});

output.on( "close", next );
archiver.pipe( output );

files = files.map(function( item ) {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit de7702a

Please sign in to comment.