aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorTimmy Willison <timmywillisn@gmail.com>2014-05-23 12:45:51 -0400
committerTimmy Willison <timmywillisn@gmail.com>2014-05-23 13:49:57 -0400
commit1d931068d30b6a516b883cf7f420606de21eab68 (patch)
tree6c43c58497f4f625529fd6968fe62a1bcd7409fd /build
parentb80700c75f2d4920ebdd81b6122fa0c4f65723b1 (diff)
downloadjquery-1d931068d30b6a516b883cf7f420606de21eab68.tar.gz
jquery-1d931068d30b6a516b883cf7f420606de21eab68.zip
Release: ensure Sizzle is the latest tag
Fixes #14915
Diffstat (limited to 'build')
-rw-r--r--build/ensure-sizzle.js40
-rw-r--r--build/release.js8
2 files changed, 48 insertions, 0 deletions
diff --git a/build/ensure-sizzle.js b/build/ensure-sizzle.js
new file mode 100644
index 000000000..01a128efb
--- /dev/null
+++ b/build/ensure-sizzle.js
@@ -0,0 +1,40 @@
+var fs = require( "fs" ),
+ bower = require( "grunt-bowercopy/node_modules/bower" ),
+ sizzleLoc = __dirname + "/../src/sizzle/dist/sizzle.js",
+ rversion = /Engine v(\d+\.\d+\.\d+(?:-\w+)?)/;
+
+/**
+ * Retrieve the latest tag of Sizzle from bower
+ * @param {Function(string)} callback
+ */
+function getLatestSizzle( callback ) {
+ bower.commands.info( "sizzle", "version" )
+ .on( "end", callback );
+}
+
+/**
+ * Ensure the /src folder has the latest tag of Sizzle
+ * @param {Object} Release
+ * @param {Function} callback
+ */
+function ensureSizzle( Release, callback ) {
+ console.log();
+ console.log( "Checking Sizzle version..." );
+ getLatestSizzle(function( latest ) {
+ var match = rversion.exec( fs.readFileSync( sizzleLoc, "utf8" ) ),
+ version = match ? match[ 1 ] : "Not Found";
+
+ if ( version !== latest ) {
+ console.log(
+ "The Sizzle version in the src folder (" + version.red +
+ ") is not the latest tag (" + latest.green + ")."
+ );
+ Release.confirm( callback );
+ } else {
+ console.log( "Sizzle is latest (" + latest.green + ")" );
+ callback();
+ }
+ });
+}
+
+module.exports = ensureSizzle;
diff --git a/build/release.js b/build/release.js
index 529137da7..9f6b2e2a9 100644
--- a/build/release.js
+++ b/build/release.js
@@ -3,6 +3,7 @@ module.exports = function( Release ) {
var
fs = require( "fs" ),
shell = require( "shelljs" ),
+ ensureSizzle = require( "./ensure-sizzle" ),
devFile = "dist/jquery.js",
minFile = "dist/jquery.min.js",
@@ -117,6 +118,13 @@ module.exports = function( Release ) {
issueTracker: "trac",
contributorReportId: 508,
/**
+ * Ensure the repo is in a proper state before release
+ * @param {Function} callback
+ */
+ checkRepoState: function( callback ) {
+ ensureSizzle( Release, callback );
+ },
+ /**
* Generates any release artifacts that should be included in the release.
* The callback must be invoked with an array of files that should be
* committed before creating the tag.