diff --git a/templates/cli/lib/commands/init.js.twig b/templates/cli/lib/commands/init.js.twig index 06e400d70..5ba2825a5 100644 --- a/templates/cli/lib/commands/init.js.twig +++ b/templates/cli/lib/commands/init.js.twig @@ -166,7 +166,9 @@ const initCollection = async ({ all, databaseId } = {}) => { if (databaseIds.length <= 0) { let answers = await inquirer.prompt(questionsInitCollection) - if (!answers.databases) process.exit(1) + if (!answers.databases) { + throw new Error("No database selected. Please retry command and select at least one with or all with .") + } databaseIds.push(...answers.databases); }