grunt-newer: Does not work with grunt-contrib-copy due to the timestamp precision disagreement

As I tried, when specify newer:copy, the files will be copied no matter whether it gets modified. As I have observed, grunt-contrib-copy uses fs.utimesSync(dest, stat.atime, stat.mtime); to sync the timestamp, which only gives second-level precision (can be reproduced by first using grunt-contrib-copy to copy the file and then stat the original file and the copied version to see). And I think grunt-newer uses more strict comparison which is based on the millisecond-level precision. I don’t know this should be either a bug or a feature enhancement for either package, but it would be great if they can work together.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 17 (6 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks so much @tschaub, @giovannipds and @jorrit - we’re using the updated version with a tolerance of 1000 and its resolved the Windows platform issues we were seeing!

New tolerance option available in grunt-newer@1.2.0. Thanks @jorrit. See #94 for details.