我怎样才能忽略文件?我想排除任何子目录中以 _ 开头的所有文件。我使用这两种方法没有成功:
this.fs.copyTpl(
this.templatePath('basicFiles/'),
this.destinationPath(''),
answers,
{ignore:"_*.*"}
);
this.fs.copyTpl(
[!*.*,this.templatePath('basicFiles/')],
this.destinationPath(''),
answers
);
更一般地说,想将每个 basic/_exmaple.json 合并(深复制)到additionalConfig/example.json 到 desitnationPaht/exmaple.json (合并)。
欢迎每一个想法:)。
For fs.copyTpl
your {ignore:"_*.*"}
需要在5th参数对象(作为syntax https://github.com/SBoudrias/mem-fs-editor#copytplfrom-to-context-templateoptions--copyoptions说)和里面globOptions
key:
this.fs.copyTpl(
this.templatePath('**/*'), // from
this.destinationRoot(), // to
{}, // context // not here
{}, // templateOptions // not here
{ globOptions: {ignore:"_*.*"} } // < but here
)
同样适用于{dot: true}
和其他此类选项。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)