nystudio107 / generator-craftplugin

generator-craftplugin is a Yeoman generator for Craft CMS plugins
MIT License
74 stars 30 forks source link

Skippable files - prevent certain deleted files from being recreated #61

Open OscarBarrett opened 6 years ago

OscarBarrett commented 6 years ago

Related to #55

Adds support for a skippable property for TEMPLATE_FILES and BOILERPLATE_FILES items.

When running the generator for a previously generated plugin, files marked as skippable will not be recreated if they no longer exist.

At this stage I've marked the following files as skippable:

It might be worth considering whether to make twig, css and js files skippable as well (in case they were renamed or not required).

Currently there's no opt-in or out for this. I could add an option to ask the user whether they want to recreate skippable files or not.

I also haven't adjusted the output - we could report the skipped files to the user.