diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-10-04 16:48:42 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-10-04 16:48:42 -0400 |
commit | f417a92c544d48dd61134b2d60336aaebf405afa (patch) | |
tree | 3eee0bd5adb5b2148df4d5ffc076d83538dbde5b /build | |
parent | d434c9a442788ed844567237b7046c34210b6564 (diff) | |
download | jquery-ui-f417a92c544d48dd61134b2d60336aaebf405afa.tar.gz jquery-ui-f417a92c544d48dd61134b2d60336aaebf405afa.zip |
Build: Generate quick download in release script.
Diffstat (limited to 'build')
-rw-r--r-- | build/release/release.js | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/build/release/release.js b/build/release/release.js index 0acd33256..77430d8d1 100644 --- a/build/release/release.js +++ b/build/release/release.js @@ -1,5 +1,5 @@ #!/usr/bin/env node -/*global cat:true echo:true exec:true exit:true cd:true*/ +/*global cat:true cd:true cp:true echo:true exec:true exit:true ls:true*/ var baseDir, repoDir, prevVersion, newVersion, nextVersion, tagTime, fs = require( "fs" ), @@ -41,6 +41,9 @@ walk([ section( "gathering contributors" ), gatherContributors, + section( "generating quick download" ), + generateQuickDownload, + section( "updating trac" ), updateTrac, confirm @@ -258,6 +261,34 @@ function gatherContributors() { echo( "Stored contributors in " + contributorsPath.cyan + "." ); } +function generateQuickDownload() { + var config, + downloadDir = repoDir + "/node_modules/download.jqueryui.com", + filename = "jquery-ui-" + newVersion + ".custom.zip", + destination = baseDir + "/" + filename; + + cd( downloadDir ); + + // Update jQuery UI version for download builder + config = JSON.parse( cat( "config.json" ) ); + config.jqueryUi = newVersion; + JSON.stringify( config ).to( "config.json" ); + + // Generate quick download + // TODO: Find a way to avoid having to clone jquery-ui inside download builder + if ( exec( "grunt prepare build" ).code !== 0 ) { + abort( "Error generating quick download." ); + } + cp( downloadDir + "/release/" + filename, destination ); + // cp() doesn't have error handling, so check for the file + if ( ls( destination ).length !== 1 ) { + abort( "Error copying quick download." ); + } + + // Go back to repo directory for consistency + cd( repoDir ); +} + function updateTrac() { echo( newVersion.cyan + " was tagged at " + tagTime.cyan + "." ); echo( "Close the " + newVersion.cyan + " Milestone with the above date and time." ); @@ -348,8 +379,8 @@ function bootstrap( fn ) { return process.exit( 1 ); } - require( baseDir + "/node_modules/shelljs/global" ); - require( baseDir + "/node_modules/colors" ); + require( "shelljs/global" ); + require( "colors" ); fn(); }); |