fix: cli no user input

This commit is contained in:
valknarness
2025-10-26 19:12:49 +01:00
parent 1bc5e564b1
commit 9eb428dd63

View File

@@ -65,19 +65,28 @@ async function rateLimitedRequest(url, options = {}) {
console.log();
// Ask user what to do
const { action } = await inquirer.prompt([
{
type: 'list',
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' }
]
}
]);
// In CI mode, automatically wait instead of prompting
const isCI = process.env.CI === 'true';
let action = 'wait';
if (!isCI) {
// Ask user what to do
const response = await inquirer.prompt([
{
type: 'list',
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') {
throw new Error('Indexing aborted by user');