【问题标题】:Custom message at the end of Yeoman generateYeoman 生成结束时的自定义消息
【发布时间】:2014-05-20 14:09:33
【问题描述】:

一切完成后,我想向用户显示一条自定义消息。我尝试编写一个end 函数,但没有被调用。

我在 Yeoman 存储库中 did ask this,但他们说它更适合 SO。

谢谢

【问题讨论】:

    标签: node.js yeoman yeoman-generator


    【解决方案1】:

    你试过做这样的事情吗?

    显示消息时记得使用this.log,如何使用优先级在documentation

    module.exports = yeoman.generators.Base.extend({
        initializing: function() {
            this.fs.copy(
                this.templatePath('blah.js'),
                this.destinationPath('blah.js')
            );
        },
        end: function() {
            this.log("All Done!");
        },
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-18
      • 1970-01-01
      • 1970-01-01
      • 2012-08-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多