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

Improved file filtering for copyDirSyncRecursive #57

Merged
merged 4 commits into from
Oct 15, 2013
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated readme based on filter improvements
  • Loading branch information
patrick-steele-idem committed Jul 25, 2013
commit c9c99d43b6f28d3ee5a590e768d551ae3467c40e
8 changes: 7 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,16 @@ wrench.copyDirSyncRecursive('directory_to_copy', 'location_where_copy_should_end
excludeHiddenUnix: bool, // Whether to copy hidden Unix files or not (preceding .)
preserveFiles: bool, // If we're overwriting something and the file already exists, keep the existing
inflateSymlinks: bool, // Whether to follow symlinks or not when copying files
filter: regexp, // A filter to match files against; if matches, do nothing (exclude).
filter: regexpOrFunction, // A filter to match files against; if matches, do nothing (exclude).
whitelist: bool, // if true every file or directory which doesn't match filter will be ignored
include: regexpOrFunction, // An include filter (either a regexp or a function)
exclude: regexpOrFunction // An include filter (either a regexp or a function)
});

*NOTE:* If a RegExp is provided then then it will be matched against the filename. If a function is
provided then the signature should be the following:
`function(filename, dir) { return result; }`

// Read lines in from a file until you hit the end
var f = new wrench.LineReader('x.txt');
while(f.hasNextLine()) {
Expand Down