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',
|
type: 'string',
|
||||||
conflicts: ['file'],
|
conflicts: ['file'],
|
||||||
description: 'The key of the environment variable for the path of the commit message 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];
|
const file = process.env[arg];
|
||||||
if (!file) {
|
if (!file) {
|
||||||
throw new Error(`Provided environment variable "${arg}" was not found.`);
|
throw new Error(`Provided environment variable "${arg}" was not found.`);
|
||||||
|
@ -2113,6 +2113,9 @@ function builder$2(yargs) {
|
|||||||
conflicts: ['file'],
|
conflicts: ['file'],
|
||||||
description: 'The key of the environment variable for the path of the commit message file.',
|
description: 'The key of the environment variable for the path of the commit message file.',
|
||||||
coerce: (arg) => {
|
coerce: (arg) => {
|
||||||
|
if (arg === undefined) {
|
||||||
|
return arg;
|
||||||
|
}
|
||||||
const file = process.env[arg];
|
const file = process.env[arg];
|
||||||
if (!file) {
|
if (!file) {
|
||||||
throw new Error(`Provided environment variable "${arg}" was not found.`);
|
throw new Error(`Provided environment variable "${arg}" was not found.`);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user