Skip to content

Added -L follow sym link option to cp#232

Closed
charlesverge wants to merge 1 commit intoshelljs:masterfrom
charlesverge:master
Closed

Added -L follow sym link option to cp#232
charlesverge wants to merge 1 commit intoshelljs:masterfrom
charlesverge:master

Conversation

@charlesverge
Copy link
Copy Markdown

Added option to allow cp to follow sym links and copy source files rather than sym link.

@ariporad
Copy link
Copy Markdown
Contributor

@charlesverge: Thanks so much for your PR! Could you please add some tests? Thanks!

@ariporad ariporad self-assigned this Jan 24, 2016
@ariporad ariporad added this to the v0.6.0 milestone Jan 24, 2016
@nfischer
Copy link
Copy Markdown
Member

👍

@nfischer
Copy link
Copy Markdown
Member

@charlesverge could you also rebase off of master? We now have Windows tests. Thanks!

@ariporad
Copy link
Copy Markdown
Contributor

ariporad commented Feb 4, 2016

@charlesverge: Hi! Would you mind rebasing this off master? We'd like to get it in v0.7.0! Thanks!

@ariporad ariporad modified the milestones: v0.7.0, v0.6.0 Feb 4, 2016
@nfischer
Copy link
Copy Markdown
Member

@charlesverge any further work on this? If not, either @ariporad or I can take this PR over.

@ariporad
Copy link
Copy Markdown
Contributor

@nfischer: I think one of us should take this over, do you want it, or should I?

@nfischer
Copy link
Copy Markdown
Member

@ariporad you can take this one if you like

@nfischer
Copy link
Copy Markdown
Member

Also, @ariporad, you might be able to also resolve #193 while you're at it, since that's related to cp and symlinks

@ariporad
Copy link
Copy Markdown
Contributor

@nfischer: #193 kind of breaks my head, I really don't get it.

@nfischer
Copy link
Copy Markdown
Member

@ariporad I might be able to take a look. I just have a lot on my plate right now, so I've been focusing on some other things. There are a couple other shelljs features that are higher up on the priority list for me.

@ariporad
Copy link
Copy Markdown
Contributor

ariporad commented Mar 5, 2016

@nfischer: I'll actually take this on.

@nfischer
Copy link
Copy Markdown
Member

@ariporad Are you still taking this on? This would be a nice feature for v0.7, but it might also be hard to get Windows compatibility.

@ariporad
Copy link
Copy Markdown
Contributor

@nfischer: I'll try. I'm not great at Windows, but I'll try.

@charlesverge
Copy link
Copy Markdown
Author

@nfischer @ariporad

I've pushed a new commit that is based off the lasted master branch it includes

  1. A maxdepth option to prevent run away recursion
  2. A check for a link cycle where a link refers to a directory with in the directory being copied
  3. Unit tests for the -L option and maxdepth

I've executed these tests on a windows 7 machine and they pass successfully.

0c3f8cb

@charlesverge
Copy link
Copy Markdown
Author

If the goal is to duplicate native behavior

On a macbook and Linux/Ubuntu a native cp -RL does no copy cycling links and copies non cycling links as directories rather than sym links.

On Windows 7 the xcopy command line gives an insufficient error for a cycling link and for the non cycling link it copies the directory structure as if it is not a link. Using the file manager results in the link being a blank directory.

@charlesverge
Copy link
Copy Markdown
Author

Also any hints on why the travis-ci build fails would be cool.

@ariporad
Copy link
Copy Markdown
Contributor

@charlesverge: It looks like you've changed the docs for cp in the docstring here, but you haven't regenerated the docs. You can do this with node scripts/generate-docs.

@charlesverge
Copy link
Copy Markdown
Author

@ariporad Looks like that was it.

@ariporad ariporad closed this in 2245536 Mar 21, 2016
@nfischer
Copy link
Copy Markdown
Member

@charlesverge thanks for the PR! Looks pretty good. If I have any questions, I'll ping this thread

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants