Template2 icon indicating copy to clipboard operation
Template2 copied to clipboard

Feature: Copy/Link file trees

Open sciurius opened this issue 5 years ago • 2 comments

Currently, the ttree copy and link settings specify patterns to be matched against the file basenames. I would like to extend this to path names.

Rationale: Often a site has a bunch of static information (images, documents, js, ...) that always must be copied as-is. It is conventional to put these in a folder 'assets'. To specify to ttree that this folder must be copied as-is, a config command

copy = ^assets/

would be appropriate, To accomplish this, apply the attached trivial patch. Chances of breaking existing configs are minimal.

Alternatively a new setting assets could be introduced to specify one or more folders that always must be copied as-is.

If we can agree on an approach I offer to provide implementation PRs.

sciurius avatar Jul 15 '20 12:07 sciurius

Why not using a different keyword like copy_dir? This way we would reduce the risk of introducing a regression on existing usages of copy and make the intent clear, that this is a directory you want to copy?

atoomic avatar Jul 15 '20 16:07 atoomic

Yes, that's what i meant (intended to mean) when I proposed assets (I called it a setting but I meant keyword). Ideally, copying would still be subject to the link settings, mainly to prevent long copy times and disk use during development.

sciurius avatar Jul 15 '20 17:07 sciurius