loreanvictor / tmplr

Automate Code Scaffolding
MIT License
26 stars 0 forks source link

Support ignore lists or include/exclude patterns #32

Open fwextensions opened 9 months ago

fwextensions commented 9 months ago

There are likely to be a number of files in a repo that are used only for scaffolding tmplr, so it would be nice if there was a simple way of not copying them to the output directory. It's possible to use remove, but it somehow seems cleaner to not copy them in the first place.

fwextensions commented 9 months ago

Maybe anything with tmplr in the filename could be ignored automatically, so a package.tmplr.json file could be used as a source for copying to an output file, but it would never be copied on its own.

loreanvictor commented 9 months ago

Wouldn't remove: **/*.tmplr.* achieve the same thing? In any case, such files aren't particularly copied over, they are cloned with the rest of the files and would need to be removed in the end.

Another solution, which is a bit more involved, would be to use temp directories. You could clone whatever files into a temp directory and only copy what you need from it. The whole directory would then be removed after the recipe has finished executing.

steps:
  - degit: user/repo
    to:
      eval: '{{ tmpdir.repo }}'

  ...