aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorRafael Xavier de Souza <rxaviers@gmail.com>2013-06-05 10:39:07 -0300
committerRafael Xavier de Souza <rxaviers@gmail.com>2013-06-26 12:40:58 -0300
commitece91a5c3b37a6aaf6077060af98b7274af2ae92 (patch)
tree9b1346ab3549777e7f7459861a7db1e4cdca472c /build
parenta52421b25f5d8f1a61049014589555690f44e7b0 (diff)
downloadjquery-ui-ece91a5c3b37a6aaf6077060af98b7274af2ae92.tar.gz
jquery-ui-ece91a5c3b37a6aaf6077060af98b7274af2ae92.zip
Release: Handle prevVersion when minor or patch are 0 (zero)
Diffstat (limited to 'build')
-rw-r--r--build/release/release.js16
1 files changed, 7 insertions, 9 deletions
diff --git a/build/release/release.js b/build/release/release.js
index df94b1c08..32f832acd 100644
--- a/build/release/release.js
+++ b/build/release/release.js
@@ -105,8 +105,7 @@ function getVersions() {
if ( preRelease ) {
newVersion = preRelease;
- // Note: prevVersion is not currently used for pre-releases. The TODO
- // below about 1.10.0 applies here as well.
+ // Note: prevVersion is not currently used for pre-releases.
prevVersion = nextVersion = currentVersion;
} else {
newVersion = currentVersion.substr( 0, currentVersion.length - 3 );
@@ -115,15 +114,14 @@ function getVersions() {
minor = parseInt( parts[ 1 ], 10 );
patch = parseInt( parts[ 2 ], 10 );
- // TODO: handle 1.10.0
- // Also see comment above about pre-releases
- if ( patch === 0 ) {
- abort( "This script is not smart enough to handle the 1.10.0 release." );
+ if ( minor === 0 && patch === 0 ) {
+ abort( "This script is not smart enough to handle major release (eg. 2.0.0)." );
+ } else if ( patch === 0 ) {
+ prevVersion = git( "for-each-ref --count=1 --sort=-authordate --format='%(refname:short)' refs/tags/" + [ major, minor - 1 ].join( "." ) + "*" ).trim();
+ } else {
+ prevVersion = [ major, minor, patch - 1 ].join( "." );
}
- prevVersion = patch === 0 ?
- [ major, minor - 1, 0 ].join( "." ) :
- [ major, minor, patch - 1 ].join( "." );
nextVersion = [ major, minor, patch + 1 ].join( "." ) + "pre";
}