build: fix crash when validating commit messages (#41949)
Fixes a crash when running the `ValidateFileModule`. PR Close #41949
This commit is contained in:
parent
6eafaa7b5e
commit
fdf2e02bff
|
@ -31,7 +31,10 @@ function builder(yargs: Argv) {
|
|||
type: 'string',
|
||||
conflicts: ['file'],
|
||||
description: 'The key of the environment variable for the path of the commit message file.',
|
||||
coerce: (arg: string) => {
|
||||
coerce: (arg: string|undefined) => {
|
||||
if (arg === undefined) {
|
||||
return arg;
|
||||
}
|
||||
const file = process.env[arg];
|
||||
if (!file) {
|
||||
throw new Error(`Provided environment variable "${arg}" was not found.`);
|
||||
|
|
|
@ -2113,6 +2113,9 @@ function builder$2(yargs) {
|
|||
conflicts: ['file'],
|
||||
description: 'The key of the environment variable for the path of the commit message file.',
|
||||
coerce: (arg) => {
|
||||
if (arg === undefined) {
|
||||
return arg;
|
||||
}
|
||||
const file = process.env[arg];
|
||||
if (!file) {
|
||||
throw new Error(`Provided environment variable "${arg}" was not found.`);
|
||||
|
|
Loading…
Reference in New Issue