From fc4ff9315d3102f9b216783061d00a2702555bd9 Mon Sep 17 00:00:00 2001 From: Timmy Willison Date: Mon, 7 Oct 2013 18:24:02 -0400 Subject: [PATCH] Add bower install script and release scripts to jshint and pass lint --- Gruntfile.js | 2 +- build/bower-install.js | 2 +- build/release-notes.js | 11 ++++------- build/release.js | 12 ++++++------ 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 6bc16a982..bd959e54c 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -66,7 +66,7 @@ module.exports = function( grunt ) { options: srcHintOptions }, grunt: { - src: [ "Gruntfile.js", "build/tasks/*" ], + src: [ "Gruntfile.js", "build/tasks/*", "build/{bower-install,release-notes,release}.js" ], options: { jshintrc: ".jshintrc" } diff --git a/build/bower-install.js b/build/bower-install.js index f83fdf51f..6114c4975 100644 --- a/build/bower-install.js +++ b/build/bower-install.js @@ -10,4 +10,4 @@ try { process.exit( 0 ); } -spawn( "bower", [ "install" ], { stdio: 'inherit' } ); +spawn( "bower", [ "install" ], { stdio: "inherit" } ); diff --git a/build/release-notes.js b/build/release-notes.js index ae50f2dc0..37e9f9a32 100644 --- a/build/release-notes.js +++ b/build/release-notes.js @@ -3,10 +3,8 @@ * jQuery Release Note Generator */ -var fs = require("fs"), - http = require("http"), +var http = require("http"), extract = /(.*?)<[^"]+"component">\s*(\S+)/g, - categories = [], version = process.argv[2]; if ( !/^\d+\.\d+/.test( version ) ) { @@ -27,13 +25,12 @@ http.request({ }); res.on( "end", function() { - var match, - file = data.join(""), - cur; + var match, cur, cat, + file = data.join(""); while ( (match = extract.exec( file )) ) { if ( "#" + match[1] !== match[2] ) { - var cat = match[3]; + cat = match[3]; if ( !cur || cur !== cat ) { if ( cur ) { diff --git a/build/release.js b/build/release.js index e0780a012..973338a88 100644 --- a/build/release.js +++ b/build/release.js @@ -102,7 +102,7 @@ function initialize( next ) { console.log( "Current version is " + pkg.version + "; generating release " + releaseVersion ); version = pkg.version.match( rsemver ); - oldver = ( +version[1] ) * 10000 + ( +version[2] * 100 ) + ( +version[3] ) + 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!" ); @@ -113,7 +113,7 @@ function initialize( next ) { } function checkGitStatus( next ) { - git( [ "status" ], function( error, stdout, stderr ) { + git( [ "status" ], function( error, stdout ) { var onBranch = ((stdout||"").match( /On branch (\S+)/ ) || [])[1]; if ( onBranch !== branch ) { dieIfReal( "Branches don't match: Wanted " + branch + ", got " + onBranch ); @@ -136,7 +136,7 @@ function tagReleaseVersion( next ) { } function gruntBuild( next ) { - exec( gruntCmd, [], function( error, stdout ) { + exec( gruntCmd, [], function( error, stdout, stderr ) { if ( error ) { die( error + stderr ); } @@ -219,10 +219,10 @@ function pushToGithub( next ) { function steps() { var cur = 0, - steps = arguments; + st = arguments; (function next(){ process.nextTick(function(){ - steps[ cur++ ]( next ); + st[ cur++ ]( next ); }); })(); } @@ -259,7 +259,7 @@ function makeArchive( cdn, files, fn ) { return "dist/" + item.replace( /VER/g, releaseVersion ); }); - exec( "md5sum", files, function( err, stdout, stderr ) { + exec( "md5sum", files, function( err, stdout ) { fs.writeFileSync( md5file, stdout ); files.push( md5file ); -- 2.39.5