Yeoman Generator因与this.copy相关的断言错误而失败

时间:2017-10-16 13:18:50

标签: yeoman yeoman-generator

这是一个较旧的Yeoman生成器,使用 this.copy

进行设置
this.copy('_editorconfig', '.editorconfig');

错误:AssertionError [ERR_ASSERTION]:尝试从不存在的源复制:_editorconfig

1 个答案:

答案 0 :(得分:0)

修复是由于处理副本的方式发生了变化。

    this.fs.copy(
        this.templatePath('_editorconfig'),
        this.destinationPath('.editorconfig')
    );

作为一个说明,这也是添加gitignore的修复

    this.fs.copy(
        this.templatePath('_gitignore'),
        this.destinationPath('.gitignore')
    );
相关问题