diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2013-04-09 08:07:21 -0400 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2013-04-09 08:09:26 -0400 |
commit | f6471f4f3668d236211d3d3e353852f0bc3a20ea (patch) | |
tree | 72234d583330b4c45f3585688999017d8968dcc6 | |
parent | 85fc5878b3c6af73f42d61eedf73013e7faae408 (diff) | |
download | jquery-f6471f4f3668d236211d3d3e353852f0bc3a20ea.tar.gz jquery-f6471f4f3668d236211d3d3e353852f0bc3a20ea.zip |
Use semantic versions.
-rw-r--r-- | build/release.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/build/release.js b/build/release.js index d2bff0f16..f29673aca 100644 --- a/build/release.js +++ b/build/release.js @@ -65,8 +65,8 @@ function initialize( next ) { // First arg should be the version number being released var newver, oldver, - rversion = /^(\d)\.(\d+)\.(\d)((?:a|b|rc)\d|pre)?$/, - version = ( process.argv[3] || "" ).toLowerCase().match( rversion ) || {}, + rsemver = /^(\d+)\.(\d+)\.(\d+)(?:-([\dA-Za-z\-]+(?:\.[\dA-Za-z\-]+)*))?$/, + version = ( process.argv[3] || "" ).toLowerCase().match( rsemver ) || {}, major = version[1], minor = version[2], patch = version[3], @@ -88,14 +88,14 @@ function initialize( next ) { pkg = JSON.parse( fs.readFileSync( "package.json" ) ); console.log( "Current version is " + pkg.version + "; generating release " + releaseVersion ); - version = pkg.version.match( rversion ); + version = pkg.version.match( rsemver ); oldver = ( +version[1] ) * 10000 + ( +version[2] * 100 ) + ( +version[3] ) newver = ( +major ) * 10000 + ( +minor * 100 ) + ( +patch ); if ( newver < oldver ) { die( "Next version is older than current version!" ); } - nextVersion = major + "." + minor + "." + ( isBeta ? patch : +patch + 1 ) + "pre"; + nextVersion = major + "." + minor + "." + ( isBeta ? patch : +patch + 1 ) + "-pre"; next(); } |