From 3d4116d044a2f5149a9c9c1d9fa35abf5e232479 Mon Sep 17 00:00:00 2001 From: escapedcat Date: Sat, 5 Sep 2020 13:13:46 +0800 Subject: [PATCH] fix(cli): remove default value from edit option #2065 move pseudo default to "main" function --- @commitlint/cli/src/cli.test.ts | 3 +-- @commitlint/cli/src/cli.ts | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/@commitlint/cli/src/cli.test.ts b/@commitlint/cli/src/cli.test.ts index 4b50e446b9..2219772327 100644 --- a/@commitlint/cli/src/cli.test.ts +++ b/@commitlint/cli/src/cli.test.ts @@ -442,8 +442,7 @@ test('should print help', async () => { --cwd, -d directory to execute in [string] [default: (Working Directory)] --edit, -e read last commit message from the specified file or - fallbacks to ./.git/COMMIT_EDITMSG - [string] [default: false] + fallbacks to ./.git/COMMIT_EDITMSG [string] --env, -E check message in the file at path given by environment variable value [string] --extends, -x array of shareable configurations to extend [array] diff --git a/@commitlint/cli/src/cli.ts b/@commitlint/cli/src/cli.ts index e1d7b5bfb5..950521817c 100644 --- a/@commitlint/cli/src/cli.ts +++ b/@commitlint/cli/src/cli.ts @@ -42,7 +42,6 @@ const cli = yargs }, edit: { alias: 'e', - default: false, description: 'read last commit message from the specified file or fallbacks to ./.git/COMMIT_EDITMSG', type: 'string', @@ -112,7 +111,7 @@ const cli = yargs ) .strict(); -main(cli.argv).catch((err) => { +main({edit: false, ...cli.argv}).catch((err) => { setTimeout(() => { if (err.type === pkg.name) { process.exit(1);