Skip to content

Commit a048e9e

Browse files
committed
test(cli): fix compatibility with linux
1 parent 76ac895 commit a048e9e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

@commitlint/cli/src/cli.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ test('should print help', async () => {
440440
--color, -c toggle colored output [boolean] [default: true]
441441
--config, -g path to the config file [string]
442442
--cwd, -d directory to execute in
443-
[string] [default: \\"__CWD__\\"]
443+
[string] [default: \\"__CWD__\\"]
444444
--edit, -e read last commit message from the specified file or
445445
fallbacks to ./.git/COMMIT_EDITMSG
446446
[string] [default: false]
@@ -479,5 +479,5 @@ async function writePkg(payload: unknown, options: TestOptions) {
479479
function escapeCwd(value: string, cwd: string): string {
480480
return value
481481
.replace(cwd, '__CWD__')
482-
.replace(/\n[ ]+(.+__CWD__)/, `\n${' '.repeat(cwd.length - 7)}$1`);
482+
.replace(/(\n[ ]+)(.+__CWD__)/, `$1${' '.repeat(cwd.length - 7)}$2`);
483483
}

0 commit comments

Comments
 (0)