mem-fs-editor
mem-fs-editor copied to clipboard
Bug: Cannot pass custom process to copyOptions
Either a bug in fs.copyTpl()
, or an error in the documentation.
Documentation says we should be able to pass in a customized process function to do manipulation/conflict resolution on the fly. (I'm attempting to automatically perform json merging on the fly based on path endings in yeoman). However, in the code, the process is defined after the spread. So any custom process passed in through options are wiped out.
https://github.com/SBoudrias/mem-fs-editor/blob/4092b3f4b68ce1e4bf2c0d335ad175972a1e0a69/lib/actions/copy-tpl.js#L27 https://github.com/SBoudrias/mem-fs-editor/blob/4092b3f4b68ce1e4bf2c0d335ad175972a1e0a69/lib/actions/copy-tpl.js#L28
Ah it's likely a "documentation error" since it is referring to the copy options.
That being said, we could handle it manually after the template is processed. Would you be willing to send a PR for this?