Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add symlink option to grunt.file.copy #1069

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jamesplease
Copy link
Member

Ref

Actually, I may have misinterpreted that issue in my early-morning sleepiness. The issue is really that it won't copy symlinks. I'll update this PR accordingly.

Presently, grunt.file.copy will take symlinks and generate new files from them. This change makes it so that symlinks are copied as symlinks.

This first commit is a rough draft showing a really basic implementation of the idea.

@vladikoff vladikoff added this to the 0.4.3 milestone Mar 4, 2014
@vladikoff vladikoff added the fs label Mar 4, 2014
@tkellen tkellen modified the milestones: 0.4.4, 0.4.3 Mar 7, 2014
@vladikoff vladikoff modified the milestones: 0.4.5, 0.4.4 Mar 12, 2014
@jamesplease
Copy link
Member Author

This is an initial take on this issue. It will copy symlinks as symlinks now, but there are a number of questions that need to be answered.

  • Should an option toggle this behavior? What's the default setting for the option?
  • It throws an error when the file already exists. Should it automatically overwrite the file? I think that it should, as regular files are overwritten.
  • May need to be tested on Windows, though it largely follows the pattern in grunt-contrib-symlink, so if that library works then this one should, as well.

It also needs some unit tests to verify all of this behavior, which I can add once these questions have been worked out.

Further considerations are the incompatibility of copying symlinks with the other options of copy, like process.

//cc @shama

@vladikoff vladikoff modified the milestone: 0.4.5 Mar 24, 2014
@cowboy
Copy link
Member

cowboy commented Mar 26, 2014

Default setting: the current behavior. We could have a {preserveSymlinks: true} option.

What throws an error when the file already exists, the current code or your new code? I think it should retain the current behavior, regardless.

Obviously process won't be run on symlinks. That can be documented.

Lots of tests!

@vladikoff vladikoff modified the milestones: 0.4.6, 0.4.5 Apr 8, 2014
@vladikoff vladikoff modified the milestones: 0.4.6, 0.4.5 May 9, 2014
@vladikoff vladikoff modified the milestones: 0.4.7, 0.4.6 Jun 19, 2014
@vladikoff vladikoff modified the milestones: 0.4.6, 0.4.7 Jul 14, 2014
@vladikoff
Copy link
Member

@jmeas 0.5.0?

@rowanthorpe
Copy link

Just chiming in to say I'm really looking forward to when this (nearly 2-year-old) PR, or something like it, is merged. I have a project which is heavy on relative symlinks within its own tree, and copying all those symlinks-as-files multiple times (to various output-dirs based on settings) is really inefficient.

Is there some kind of deadlock of issues causing this not to progress? I see there is a reference from this related PR for grunt-contrib-clean (which is 2.5 years old), and can't understand if there is some "blocker" or if these PRs have just been left to go stale...? If someone knows it is just extra coding-time needed somewhere else, and are too busy, please point me to the issue(s) - I could try to take a look myself.

@k-funk
Copy link

k-funk commented Apr 21, 2016

+1

@shama
Copy link
Member

shama commented Apr 21, 2016

Hey! Sorry for the massive delay on this. I'd be happy to merge and release on an upcoming minor version. We just need to address the comments @cowboy has made first.

@shama shama removed this from the 0.4.6 milestone Apr 21, 2016
@jamesplease
Copy link
Member Author

I prob. won't have time to update this, so if anyone wants to take it over feel free.

@GuillaumeLeclerc
Copy link

Any news ?

@shama
Copy link
Member

shama commented Nov 13, 2016

@GuillaumeLeclerc Feel free to click the "Subscribe" button under notifications on the right. That will give you a notification if there is any news on this PR.

Base automatically changed from master to main March 22, 2021 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants