tschaub / grunt-newer

Configure Grunt tasks to run with newer files only.
https://npmjs.org/package/grunt-newer
MIT License
945 stars 53 forks source link

Issue with Tasks that also do filtering (ex.grunt-contrib-copy) #23

Open purtuga opened 10 years ago

purtuga commented 10 years ago

I came across this issue that I wanted to report back you.. Before finding grunt-newer, I was using the following task for copy:

copy: {
    build: {
        src:    ['src/**/*'],
        dest:   userOpt.buildLocation + '/<%= pkg.name %>/',
        expand: true,
        filter: onlyNew(['copy', 'build'])
    }
}

Notice the filter option is defined, which is a function that in itself looks at timestamps and determine which files should be copied based on that (ps. I'll be commenting out that line, now that I have found your grunt plugin).

The problem is that when I run it with the above setup, I get the following:

Running "newer:copy:build" (newer) task
Files: src/MyBoard.Dev.aspx -> C:/BUILD/SPListBoard/src/MyBoard.Dev.aspx
Files: src/MyBoard.aspx -> C:/BUILD/SPListBoard/src/MyBoard.aspx

Running "copy:build" (copy) task
Verifying property copy.build exists in config...OK
Files: [no src] -> C:/BUILD/SPListBoard/src/MyBoard.Dev.aspx
Files: [no src] -> C:/BUILD/SPListBoard/src/MyBoard.aspx
Options: processContent=undefined, processContentExclude=["**/*.{png,gif,jpg,ico,psd}"]

Running "newer-postrun:copy:build:1:C:/BUILD/SPListBoard/build/" (newer-post
run) task
Writing C:\BUILD\SPListBoard\build\copy\build\timestamp...OK

Looks like the reference to the two files that were changed above were lost.

Again, just want to report it case others are encountering the same issue. In my case, I'll be removing that filter since grunt-newer will be taking its place.

Paul.

tschaub commented 10 years ago

Thanks for the report. Losing the filter is a legitimate bug that can be fixed.

purtuga commented 10 years ago

Thanks Tim for the quick reply.