From 9eb428dd63e758d474bbefa0fa269b23b5ba37d8 Mon Sep 17 00:00:00 2001 From: valknarness Date: Sun, 26 Oct 2025 19:12:49 +0100 Subject: [PATCH] fix: cli no user input --- lib/github-api.js | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/lib/github-api.js b/lib/github-api.js index 9c69ebb..1185934 100644 --- a/lib/github-api.js +++ b/lib/github-api.js @@ -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');