From 4122a1696f2e9930c6ef217bc66e665fb1706dda Mon Sep 17 00:00:00 2001 From: Raul Catalinas <105791463+RaulCatalinas@users.noreply.github.com> Date: Tue, 30 Apr 2024 12:20:27 +0200 Subject: [PATCH] feat: add prompt for configuring commitlint with Husky --- src/utils/add-commitlint.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/utils/add-commitlint.ts diff --git a/src/utils/add-commitlint.ts b/src/utils/add-commitlint.ts new file mode 100644 index 0000000..62a4c73 --- /dev/null +++ b/src/utils/add-commitlint.ts @@ -0,0 +1,17 @@ +import inquirer from 'inquirer' + +export async function addCommitlint(): Promise { + try { + const { addCommitlint } = await inquirer.prompt({ + type: 'confirm', + default: true, + name: 'addCommitlint', + message: 'Do you wanna add commitlint?:' + }) + + return addCommitlint + } catch (error) { + console.error(error) + throw new Error('Something went wrong, try again later.') + } +}