p2cli icon indicating copy to clipboard operation
p2cli copied to clipboard

Select specific files for rendering when directory mode is enabled

Open tobiade opened this issue 2 years ago • 1 comments

Hello, I have a feature request and wondering if it's worth implementing or not. Essentially, I have a folder containing a bunch of configuration files and templates e.g. CloudWatch configs, Dockerfiles etc. Like so:

configuration
├── cloudwatch
│   └── cloudwatch_config.p2.json
└── docker
    └── Dockerfile

I'm using p2's --directory-mode to render templates, and the templates have a .p2 suffix which is removed by using the --directory-mode-filename-substr-del flag.

In the (highly) unlikely event that one of my non-template configuration files (e.g. Dockerfile in the example above) has p2-recognisable syntax, then p2 will attempt to render that file as a template. I was wondering if it's worth adding a filter to only render files that have the .p2 suffix.

tobiade avatar Jan 20 '23 00:01 tobiade

Hey @wrouesnel thoughts on this? I can raise a PR.

tobiade avatar Jul 05 '23 22:07 tobiade