UNPKG

kef-kit-buffet

Version:

buffet kit

32 lines (29 loc) 733 B
'use strict'; const debug = require('debug')('buffet'); const path = require('path'); const chalk = require('chalk'); const fs = require('fs'); module.exports = function(Kit, def, user){ return { 'arguments': { 'type': { 'choices': { 'page': '添加页面', // -> def add p 'mod': '添加模块' // -> def add m } } }, options: {}, action: function* (type, names, opts) { // 创建页面 还可能是创建模块 if (type == 'mod') { return def.log.info('未实现mod'); } // generator + 对应的type目录 yield def.kit.yo.run({ generator: 'kef-generator-buffet:' + type, argv: [''] }); } }; };