ryanmcgrath/wrench-js — pull request #17 by jannon (2012-02-11 00:27:21+00:00)
Title: Making copy a little friendlier (allowing existing directories)

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.