我有这样的功能:
const runInteractive = (rows, dups) => {
const keys = new Set(dups);
const questions = _(rows)
.filter(row => keys.has(row.key))
.groupBy(row => row.key)
.map((rows, key) => ({
type: 'list',
name: key.replace('.', ','),
message: `Pick a value for ${key}`,
choices: rows.map(row => ({ name: row.value, value: row, short: '✔' }))
}))
.value();
return inquirer
.prompt(questions)
.then(answers => _.sortBy(rows.filter(row => !keys.has(row.key)).concat(Object.values(answers)), row => row.key));
};
我从 shebang 节点脚本调用它。
该过程正在显示询问者提示,然后死亡。
我怎样才能让它活着让用户输入输入?