|
1 | 1 | #!/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*/ |
3 | 3 |
|
4 | 4 | var baseDir, repoDir, prevVersion, newVersion, nextVersion, tagTime,
|
5 | 5 | fs = require( "fs" ),
|
|
41 | 41 | section( "gathering contributors" ),
|
42 | 42 | gatherContributors,
|
43 | 43 |
|
| 44 | + section( "generating quick download" ), |
| 45 | + generateQuickDownload, |
| 46 | + |
44 | 47 | section( "updating trac" ),
|
45 | 48 | updateTrac,
|
46 | 49 | confirm
|
@@ -258,6 +261,34 @@ function gatherContributors() {
|
258 | 261 | echo( "Stored contributors in " + contributorsPath.cyan + "." );
|
259 | 262 | }
|
260 | 263 |
|
| 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 | + |
261 | 292 | function updateTrac() {
|
262 | 293 | echo( newVersion.cyan + " was tagged at " + tagTime.cyan + "." );
|
263 | 294 | echo( "Close the " + newVersion.cyan + " Milestone with the above date and time." );
|
@@ -348,8 +379,8 @@ function bootstrap( fn ) {
|
348 | 379 | return process.exit( 1 );
|
349 | 380 | }
|
350 | 381 |
|
351 |
| - require( baseDir + "/node_modules/shelljs/global" ); |
352 |
| - require( baseDir + "/node_modules/colors" ); |
| 382 | + require( "shelljs/global" ); |
| 383 | + require( "colors" ); |
353 | 384 |
|
354 | 385 | fn();
|
355 | 386 | });
|
|
0 commit comments