为什么我的生成器方法没有继承?

时间:2014-12-11 15:58:07

标签: yeoman lodash yeoman-generator

我试图制造一台发电机,然后我可以扩展它以形成类似的子发电机

这是我的基础生成器:

var generators = require('yeoman-generator');

var VolumeAdderBase = module.exports = generators.Base.extend({

    initializing: function() {
        /* ... */
    },

    prompting: function () {
        /* ... */
    },

    writing: function () {
        /* ... */
    }

});

这是一个示例子发电机:

var VolumeAdderBase = require('../../utils/VolumeAdderBase.js');

// console.log(VolumeAdderBase);

module.exports = VolumeAdderBase.extend({

    fileType: "tomcat script",
    containerName: "tomcat",
    containerVolumeLocation: "/opt/tomcat/client-conf/"
});

当我尝试运行我的子发电机时,它什么都不做。没有错误,没有任何错误。

当我转储VolumeAdderBase对象时,那里有很多方法,但它们都是Base个。 VolumeAdderBase中定义的内容缺失。

我在这里遗漏了什么吗?或者有更好的方法来创建类似的子生成器吗?

0 个答案:

没有答案