From 4dffa44d02a80408c3a2f0992f9a9357acd571b1 Mon Sep 17 00:00:00 2001 From: fliitor <117680686+fliitor@users.noreply.github.com> Date: Sat, 27 May 2023 08:43:46 +0300 Subject: [PATCH 1/2] Alert user if not database selected on initCollection --- templates/cli/lib/commands/init.js.twig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/cli/lib/commands/init.js.twig b/templates/cli/lib/commands/init.js.twig index 06e400d70..e7904190f 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 .") + } databaseIds.push(...answers.databases); } From 0a69e68b186524969d4caa278004df895f0804a8 Mon Sep 17 00:00:00 2001 From: fliitor <117680686+fliitor@users.noreply.github.com> Date: Sun, 11 Jun 2023 18:19:37 +0300 Subject: [PATCH 2/2] Update templates/cli/lib/commands/init.js.twig Co-authored-by: Damodar Lohani --- templates/cli/lib/commands/init.js.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/cli/lib/commands/init.js.twig b/templates/cli/lib/commands/init.js.twig index e7904190f..5ba2825a5 100644 --- a/templates/cli/lib/commands/init.js.twig +++ b/templates/cli/lib/commands/init.js.twig @@ -167,7 +167,7 @@ const initCollection = async ({ all, databaseId } = {}) => { if (databaseIds.length <= 0) { let answers = await inquirer.prompt(questionsInitCollection) if (!answers.databases) { - throw new Error("No database selected. Please retry command and select at least one with or .") + throw new Error("No database selected. Please retry command and select at least one with or all with .") } databaseIds.push(...answers.databases); }