diff --git a/dev-infra/commit-message/validate-file/cli.ts b/dev-infra/commit-message/validate-file/cli.ts index 82f9800c3e93e..8ba2d5b2856b3 100644 --- a/dev-infra/commit-message/validate-file/cli.ts +++ b/dev-infra/commit-message/validate-file/cli.ts @@ -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.`); diff --git a/dev-infra/ng-dev.js b/dev-infra/ng-dev.js index 4b32b869bd67f..092428181995d 100755 --- a/dev-infra/ng-dev.js +++ b/dev-infra/ng-dev.js @@ -2101,6 +2101,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.`);