Skip to content

Commit f417a92

Browse files
committed
Build: Generate quick download in release script.
1 parent d434c9a commit f417a92

File tree

1 file changed

+34
-3
lines changed

1 file changed

+34
-3
lines changed

build/release/release.js

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env node
2-
/*global cat:true echo:true exec:true exit:true cd:true*/
2+
/*global cat:true cd:true cp:true echo:true exec:true exit:true ls:true*/
33

44
var baseDir, repoDir, prevVersion, newVersion, nextVersion, tagTime,
55
fs = require( "fs" ),
@@ -41,6 +41,9 @@ walk([
4141
section( "gathering contributors" ),
4242
gatherContributors,
4343

44+
section( "generating quick download" ),
45+
generateQuickDownload,
46+
4447
section( "updating trac" ),
4548
updateTrac,
4649
confirm
@@ -258,6 +261,34 @@ function gatherContributors() {
258261
echo( "Stored contributors in " + contributorsPath.cyan + "." );
259262
}
260263

264+
function generateQuickDownload() {
265+
var config,
266+
downloadDir = repoDir + "/node_modules/download.jqueryui.com",
267+
filename = "jquery-ui-" + newVersion + ".custom.zip",
268+
destination = baseDir + "/" + filename;
269+
270+
cd( downloadDir );
271+
272+
// Update jQuery UI version for download builder
273+
config = JSON.parse( cat( "config.json" ) );
274+
config.jqueryUi = newVersion;
275+
JSON.stringify( config ).to( "config.json" );
276+
277+
// Generate quick download
278+
// TODO: Find a way to avoid having to clone jquery-ui inside download builder
279+
if ( exec( "grunt prepare build" ).code !== 0 ) {
280+
abort( "Error generating quick download." );
281+
}
282+
cp( downloadDir + "/release/" + filename, destination );
283+
// cp() doesn't have error handling, so check for the file
284+
if ( ls( destination ).length !== 1 ) {
285+
abort( "Error copying quick download." );
286+
}
287+
288+
// Go back to repo directory for consistency
289+
cd( repoDir );
290+
}
291+
261292
function updateTrac() {
262293
echo( newVersion.cyan + " was tagged at " + tagTime.cyan + "." );
263294
echo( "Close the " + newVersion.cyan + " Milestone with the above date and time." );
@@ -348,8 +379,8 @@ function bootstrap( fn ) {
348379
return process.exit( 1 );
349380
}
350381

351-
require( baseDir + "/node_modules/shelljs/global" );
352-
require( baseDir + "/node_modules/colors" );
382+
require( "shelljs/global" );
383+
require( "colors" );
353384

354385
fn();
355386
});

0 commit comments

Comments
 (0)