const prompts = require('prompts'); const config = require('./config'); const utils = require('./utils'); class run { constructor() { this.showHome() } async showHome() { const homeRes = await prompts([ config.home ]) if (!utils.checkActionType(homeRes.value)) { // console.log("非批量操作") const actionListRes = await prompts([ config.actionList ]) console.log("response: ", homeRes) console.log("actionListRes: ", actionListRes) } else { // console.log("批量操作") } // const response = await prompts([ // { // type: 'select', // name: 'value', // message: 'Pick a color', // choices: [ // { title: 'Red', description: 'This option has a description', value: '#ff0000' }, // { title: 'Green', value: '#00ff00', disabled: true }, // { title: 'Blue', value: '#0000ff' } // ], // initial: 1 // } // ]) } } new run();