UNPKG

kef-kit-buffet

Version:

buffet kit

37 lines (33 loc) 832 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 { options: { app: { alias: 'app', description: '中后台系统页面项目初始化', canChoose: true }, act: { alias: 'act', description: '移动端项目初始化', canChoose: true } }, action: function*(opts) { // 如果在内网直接获取用户信息,传递给generator try { user = yield def.auth.user(); } catch (e) {} let type = 'app'; yield def.kit.yo.run({ generator: 'kef-generator-buffet:' + type, // 传参 argv: ['--user', JSON.stringify(user)] }); } }; };