fix: cli no user input
This commit is contained in:
@@ -65,19 +65,28 @@ async function rateLimitedRequest(url, options = {}) {
|
|||||||
|
|
||||||
console.log();
|
console.log();
|
||||||
|
|
||||||
// Ask user what to do
|
// In CI mode, automatically wait instead of prompting
|
||||||
const { action } = await inquirer.prompt([
|
const isCI = process.env.CI === 'true';
|
||||||
{
|
let action = 'wait';
|
||||||
type: 'list',
|
|
||||||
name: 'action',
|
if (!isCI) {
|
||||||
message: 'What would you like to do?',
|
// Ask user what to do
|
||||||
choices: [
|
const response = await inquirer.prompt([
|
||||||
{ name: `Wait ${waitMinutes} minutes and continue`, value: 'wait' },
|
{
|
||||||
{ name: 'Skip remaining items and continue with what we have', value: 'skip' },
|
type: 'list',
|
||||||
{ name: 'Abort indexing', value: 'abort' }
|
name: 'action',
|
||||||
]
|
message: 'What would you like to do?',
|
||||||
}
|
choices: [
|
||||||
]);
|
{ name: `Wait ${waitMinutes} minutes and continue`, value: 'wait' },
|
||||||
|
{ name: 'Skip remaining items and continue with what we have', value: 'skip' },
|
||||||
|
{ name: 'Abort indexing', value: 'abort' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
action = response.action;
|
||||||
|
} else {
|
||||||
|
console.log(chalk.cyan('🤖 CI mode detected: automatically waiting...'));
|
||||||
|
}
|
||||||
|
|
||||||
if (action === 'abort') {
|
if (action === 'abort') {
|
||||||
throw new Error('Indexing aborted by user');
|
throw new Error('Indexing aborted by user');
|
||||||
|
|||||||
Reference in New Issue
Block a user