grunt-init template conditional prompts

假装没事ソ 提交于 2019-12-06 14:49:13

The init property exposes a init.prompts() object which you could modify based on the answers.

Something like this:

exports.template = function(grunt, init, done) {
    init.process([
        init.prompt('create_github_issue', function(value, props, done) {
            init.prompts['milestone'] = init.prompt('milestone');
            done();
        })
    ], function(err, props) {
        // handle all the props
        done();
    });
};

See the gruntplugin template for how to implement an init task.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!