Add support for glob to create only selected directories
This PR adds support for customizing the glob used to find the files to create and remove proxies for.
I want to use cherry-pick for a project where the source directory contains many files but where I only need a single proxy directory for one of them.
While putting this together I realized that when cherry-pick is being run in the prepublish hook and cherry-pick clean is being run in the postpublish hook and when files in package.json only specifies the desired proxy directories then creating additional ones is almost not an issue. Still, I find it nice to be able to specify only the ones I need. If nothing else it at least makes cherry-picks output a lot cleaner when it doesn't include many unwanted directories.
The PR also adds the Prettier config to package.json so that it can be picked up by editor plugins etc.
Overally this is a good enhancement, I'm only worried about using user-provided globs atm as we don't support outputting nested directories (which would be another good enhancement to be made, but probably slightly more complex and should be done separately).
Maybe we should just allow for comma-separated entries now? as in --entries file1,file2? This would ensure noone is trying to use globs for nested directories which wouldnt work anyway right now?
I don't have a strong opinion either way :smile: I implemented the glob as that's what you suggested back in https://github.com/funkia/list/pull/52. But two arguments for keeping globs could be
- Even without support for nested directories they are still more powerful than a simple list
- If support for nested directories gets added in the future it would be nice to not have to switch from a list to a glob.
On the other hand a list of is entries is nice due to its simplicity.
Let's keep the glob, but would be good to validate against catching nested directories with it - better to fail fast rather than later.
What about ignoring any matched files in nested directories and additionally logging a warning that they have been ignored?
Sounds good too 👌
Great. I'll update the PR later in the week :smile: