ehynds / grunt-remove-logging

Grunt.js task for removing console logging statements
MIT License
192 stars 33 forks source link

Fatal error when processing non file #10

Closed thomaswelton closed 11 years ago

thomaswelton commented 11 years ago

Here is my Gruntfile task definition (coffeeScript)

removelogging:
    files:
        expand: true
        cwd: 'app'
        src: ['**/*.js']
        dest: 'app'
        ext: '.js'

When I wrote it I mean for src: ['**/*.js'] to select all javascript files. But in my project I have a bower component stored in a folder named validate.js removelogging was attempting to process the directory and failing.

screen shot 2013-06-04 at 10 29 57

I can fix this from my gruntfile by adding an isFile filter

removelogging:
    files:
                filter: 'isFile'
        expand: true
        cwd: 'app'
        src: ['**/*.js']
        dest: 'app'
        ext: '.js'

But I think checking to see if an item is a file should be part of the core of this module. Submitting a PR