]> source.dussan.org Git - jquery-ui.git/commitdiff
Grunt: Added task for generating the list of authors.
authorScott González <scott.gonzalez@gmail.com>
Mon, 14 May 2012 21:19:10 +0000 (17:19 -0400)
committerScott González <scott.gonzalez@gmail.com>
Mon, 14 May 2012 21:19:10 +0000 (17:19 -0400)
grunt.js

index 202779e0b4e517c976647a6fc87cf87322e7f6e1..98e8b30f55a09db0ba3be9459add68caf9995893 100644 (file)
--- a/grunt.js
+++ b/grunt.js
@@ -572,6 +572,30 @@ grunt.registerTask( "clean", function() {
        require( "rimraf" ).sync( "dist" );
 });
 
+grunt.registerTask( "authors", function() {
+       var done = this.async();
+
+       grunt.utils.spawn({
+               cmd: "git",
+               args: [ "log", "--pretty=%an <%ae>" ]
+       }, function( err, result ) {
+               if ( err ) {
+                       grunt.log.error( err );
+                       return done( false );
+               }
+
+               var authors,
+                       tracked = {};
+               authors = result.split( "\n" ).reverse().filter(function( author ) {
+                       var first = !tracked[ author ];
+                       tracked[ author ] = true;
+                       return first;
+               }).join( "\n" );
+               grunt.log.writeln( authors );
+               done();
+       });
+});
+
 grunt.registerTask( "default", "lint csslint htmllint qunit" );
 grunt.registerTask( "sizer", "concat:ui min:dist/jquery-ui.min.js compare_size:all" );
 grunt.registerTask( "sizer_all", "concat:ui min compare_size" );