Skip to content
This repository has been archived by the owner on Jun 19, 2019. It is now read-only.

new features in copyDirRecursive #55

Closed
wants to merge 7 commits into from

Conversation

refaelos
Copy link
Contributor

Fixed an issue with error handling in 'rmdirRecursive'

changed the way copyDirRecursive works.

  • paths needed to be normalized
  • using 'preserve' instead of 'forceDelete'. it makes more sense to let users decide if they want to keep the existing folders/subfolders then to ask them if they want to 'forceDelete' the old ones. The default operation will be to keep existing folders.
  • added (and fixed) 'inflateSymLinks'. It's a new option that allows users do decide if they want to copy symlinks from original folder as new folders or just copy the symlink.
  • added 'excludeHiddenUnix' to let users exclude hidden files during copy (only on Unix).

- replaces 'forceDelete' with 'preserve'.
- added an option to get 'excludeHiddenUnix'
= added an option to get 'inflateSymlinks'
- paths needed to be normalized
- using 'preserve' instead of 'forceDelete'. it makes more sense to let users decide if they want to keep the existing folders/subfolders then to ask them if they want to 'forceDelete' the old ones. The default operation will be to keep existing folders.
- added (and fixed) 'inflateSymLinks'. It's a new option that allows users do decide if they want to copy symlinks from original folder as new folders or just copy the symlink.
'mkdirp' is a useful tool to async mkdir recursive that doesn't fail if the folder exists.
@ryanmcgrath
Copy link
Owner

Mmm, the behavior of forceDelete is the way I think I want this library to stay, as it's what people seemed to be largely expecting (and then were getting subsequently confused by) when they used the library. The way you're doing it is akin to what we had before.

I'm confused by what you mean when you say you "added" inflateHiddenSymlinks and excludeHiddenUnix - those already existed in the library. Did you mean to say you fixed them...?

@refaelos
Copy link
Contributor Author

Ok. I'll fix what i did.

About inflateHiddenSymlinks and excludeHiddenUnix: Those were in the 'sync' version of the function but not in this one.

@simonlevasseur
Copy link

Can the documentation be updated for the forceDelete -> preserve change?

@ryanmcgrath
Copy link
Owner

I borrowed a few things from this, but basically ended up cherry picking from a few different pull requests. 5 months late, but thanks yo.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants