gruntjs / gruntjs/grunt

Add hardLink option to grunt.file.copy

Open
#797 4 comments 0 reactions 0 assignees View on GitHub
Component: fs
Dominant language
JavaScript
Stars
12.2k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

I have a build process with grunt that copies a bunch of files (and does some other work), and use grunt watch to keep those copies up to date. But sometimes it lags behind enough that it annoys me, like when I reload a test and I don't get the updated version of a file.

Using hard links instead of copies would alleviate that problem, as edits would be immediately/automatically propagated. It's kind of a hack, but it'd be helpful.

I suggested [adding this to contrib-copy](https://github.com/gruntjs/grunt-contrib-copy/pull/75), but it interacts with the options to grunt.file.copy, and would make more sense if implemented directly there. Specifically any time `processContent` applies to a file it shouldn't be hard linked.

The idea behind a hardLink option would be hard-link-if-you-can, and on platforms without that option it would do a copy, or copy when a hard link isn't possible (e.g., across devices).

(I can probably put together a pull request, but I wanted to open it up for discussion first to see if it'd be accepted.)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.