Make WordPress Core

Ticket #28464: 28464.diff

File 28464.diff, 1.0 KB (added by MattyRob, 11 years ago)
  • Gruntfile.js

     
    271271
    272272                                        return false;
    273273                                }
     274                        },
     275                        plugins: {
     276                                expand: true,
     277                                cwd: SOURCE_DIR + 'wp-content/plugins',
     278                                src: [
     279                                        '**/*.js',
     280                                        '!**/*.min.js'
     281                                ],
     282                                // Limit JSHint's run to a single specified folder:
     283                                //
     284                                //    grunt jshint:plugins --folder=foldername
     285                                //
     286                                // Optionally, include the folder path:
     287                                //
     288                                //    grunt jshint:plugins --folder=foldername
     289                                //
     290                                filter: function( folderpath ) {
     291                                        var index, folder = grunt.option( 'folder' );
     292
     293                                        // Don't filter when no target folder is specified
     294                                        if ( ! folder ) {
     295                                                return true;
     296                                        }
     297
     298                                        folderpath = folderpath.replace( /\\/g, '/' );
     299                                        index = folderpath.lastIndexOf( '/' + folder );
     300
     301                                        // Match only the folder name passed from cli
     302                                        if ( -1 !== index ) {
     303                                                return true;
     304                                        }
     305
     306                                        return false;
     307                                }
    274308                        }
    275309                },
    276310                qunit: {