Skip to content

Commit e8b69d1

Browse files
committed
refactor(cli): remove old broken husky params fallback
1 parent ca74d90 commit e8b69d1

File tree

2 files changed

+0
-33
lines changed

2 files changed

+0
-33
lines changed

@commitlint/cli/src/cli.js

-15
Original file line numberDiff line numberDiff line change
@@ -224,21 +224,6 @@ function getEditValue(flags) {
224224
if (typeof edit === 'boolean') {
225225
return edit;
226226
}
227-
// The recommended method to specify -e with husky was `commitlint -e $GIT_PARAMS`
228-
// This does not work properly with win32 systems, where env variable declarations
229-
// use a different syntax
230-
// See https://github.com/marionebl/commitlint/issues/103 for details
231-
// This has been superceded by the `-E GIT_PARAMS` / `-E HUSKY_GIT_PARAMS`
232-
if (edit === '$GIT_PARAMS' || edit === '%GIT_PARAMS%') {
233-
console.warn(`Using environment variable syntax (${edit}) in -e |\
234-
--edit is deprecated. Use '{-E|--env} GIT_PARAMS instead'`);
235-
if (!('GIT_PARAMS' in process.env)) {
236-
throw new Error(
237-
`Received ${edit} as value for -e | --edit, but GIT_PARAMS is not available globally.`
238-
);
239-
}
240-
return process.env.GIT_PARAMS;
241-
}
242227
return edit;
243228
}
244229

@commitlint/cli/src/cli.test.js

-18
Original file line numberDiff line numberDiff line change
@@ -109,24 +109,6 @@ test('should work with husky commitmsg hook in sub packages', async () => {
109109
await execa('git', ['commit', '-m', '"test: this should work"'], {cwd});
110110
});
111111

112-
test('should work with husky via commitlint -e $GIT_PARAMS', async () => {
113-
const cwd = await git.bootstrap('fixtures/husky/integration');
114-
await writePkg({scripts: {commitmsg: `'${bin}' -e $GIT_PARAMS`}}, {cwd});
115-
116-
await execa('npm', ['install'], {cwd});
117-
await execa('git', ['add', 'package.json'], {cwd});
118-
await execa('git', ['commit', '-m', '"test: this should work"'], {cwd});
119-
});
120-
121-
test('should work with husky via commitlint -e %GIT_PARAMS%', async () => {
122-
const cwd = await git.bootstrap('fixtures/husky/integration');
123-
await writePkg({scripts: {commitmsg: `'${bin}' -e %GIT_PARAMS%`}}, {cwd});
124-
125-
await execa('npm', ['install'], {cwd});
126-
await execa('git', ['add', 'package.json'], {cwd});
127-
await execa('git', ['commit', '-m', '"test: this should work"'], {cwd});
128-
});
129-
130112
test('should allow reading of environment variables for edit file, succeeding if valid', async t => {
131113
const cwd = await git.bootstrap();
132114
await sander.writeFile(cwd, 'commit-msg-file', 'foo');

0 commit comments

Comments
 (0)