const buildDoc = require('./doc')

async function build(type) {
  const buildHandler = {
    doc: buildDoc, // 处理文档生成
  }
  if (Object.prototype.hasOwnProperty.call(buildHandler, type)) {
    await buildHandler[type]()
  }
}

// 打包命令处理
async function execBuild(options) {
  Object.keys(options).forEach(async (type) => {
    await build(type)
  })
}

module.exports = execBuild
