codeBelt / generate-template-files

A simple generator to create custom template files for any application
https://medium.com/@robertsavian/generate-template-files-with-ease-19b320615359
MIT License
209 stars 31 forks source link

Non-interactive mode #61

Closed TikiTDO closed 3 years ago

TikiTDO commented 3 years ago

This PR introduces a batch mode to the generator, which can be used to programmatically create a bunch of files in one go. This can be extremely useful when bootstrapping a system since such an operation often requires creating a lot of files from a list. This approach is also much easier to integrate with an IDE, opening up the potential for an extension that hooks into the generator.

Closes #47

TikiTDO commented 3 years ago

Right now it's set to run prettier on .md files, which breaks the aligning you had for the Case Converters section. I've changed it up a bit so the results are still aligned, but the comment starts immediately after the line, since that's where prettier wants it.

TikiTDO commented 3 years ago

I fixed up both the tests. The commandLine test was expecting an thrown error, but it's currently set up to log the error. I update the test to validate the log (and to avoid logging anything to the screen in the process). I'm not sure which of the approaches you prefer so you may want to take a glance.

I also changed the .editorconfig file to set TS indentation rule to 2 space in order to match the prettier config.

codeBelt commented 3 years ago

@TikiTDO I will review later and try to get this out today.

TikiTDO commented 3 years ago

Many thanks