UNPKG

cyb-cli

Version:

塞伯坦CYB-CLI是面向前端模块化工程的构建工具。主要目的是帮助开发者统一前端开发模式和项目开发结构,提高功能扩展和降低维护成本,自动化前端工作流,提高开发效率和开发质量。

26 lines (23 loc) 687 B
/** * ================================= * @2018 塞伯坦-CYB前端模块化工程构建工具 * https://github.com/jd-cyb/cyb-cli * ================================= */ const path = require('path') const inquirer = require('inquirer') const create = require('./lib/create') const checkTemplatePath = require('./lib/init-temp-path') module.exports = () => { checkTemplatePath() .then((templatePath) => { inquirer.prompt([...(require(path.join(templatePath, './config')).prompts)]) .then(answers => { create(answers, templatePath) }).catch((error) => { if (error) { throw new Error(error) } }) }) }