launch-pad icon indicating copy to clipboard operation
launch-pad copied to clipboard

Add support for `filter`

Open winsmith opened this issue 6 years ago • 1 comments

Add support for CKAN's filter directive.

winsmith avatar Apr 17 '18 10:04 winsmith

Here are some thoughts about this: Before, when just copying entire folders, I just pointed Cocoa's FileManager towards a directory and a target directory, and it would do the right thing.

With directives like filter, filter_regexp, include_only, etc., we

  1. have to build up a list of files in the correct directories to copy,
  2. then filter them, or regex_filter them,
  3. then check any rename directives, updating the destination directory names and destination file names if necessary
  4. and then copy them to the destination, creating any intermediate directories in-between.

Doing this right is a bit daunting, and I have kinda recoiled from the complexity of this, because I always feel like there MUST be a super easy way to do this that I'm just overlooking. But I guess since I haven't found any easy ways to in the meantime, I'm just gonna go ahead and try to do it the hard way. Suggestions are very welcome.

winsmith avatar Jul 07 '18 13:07 winsmith