ryanmcgrath / wrench-js

Recursive file operations in Node.js
MIT License
435 stars 71 forks source link

Making copy a little friendlier (allowing existing directories) #17

Closed jannon closed 12 years ago

jannon commented 12 years ago

Let's play nice. Now when using copyDirSyncRecursive, you can pass an optional opts object. If this object contains a preserve member, then the function will preserve exisiting directories and only overwrite existing files within the directories. Without passing the option it behaves the same as always. Small change, big convenience.

So before, when doing something like this:

wrench.copyDirSyncRecursive('plugins', path.join("jsdoc", "plugins"));

whatever was already in that plugins directory would get blown away.

Now you can do this:

wrench.copyDirSyncRecursive('plugins', path.join("jsdoc", "plugins"), {preserve: true});

and the plugins directory and anything in it that is not in the directory you are copying will be preserved.

ryanmcgrath commented 12 years ago

I've been sick for the past week, no pull requests have been getting the attention they deserved. This has now been merged.