mem-fs-editor icon indicating copy to clipboard operation
mem-fs-editor copied to clipboard

Bug: Cannot pass custom process to copyOptions

Open JRichlen opened this issue 2 years ago • 1 comments

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

JRichlen avatar Jul 13 '22 19:07 JRichlen

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?

SBoudrias avatar Jul 13 '22 20:07 SBoudrias