Fix coerce usage

This commit is contained in:
Sean Lilley 2021-07-22 19:42:28 -04:00
parent 2516510682
commit bf4f5fd973
1 changed files with 6 additions and 0 deletions

View File

@ -25,6 +25,9 @@ const argv = yargs
type : 'string', type : 'string',
demandOption : true, demandOption : true,
coerce : function (p) { coerce : function (p) {
if (!defined(p)) {
return undefined;
}
if (p.length === 0) { if (p.length === 0) {
throw new Error('Input path must be a file name'); throw new Error('Input path must be a file name');
} }
@ -36,6 +39,9 @@ const argv = yargs
describe : 'Path of the converted glTF or glb file.', describe : 'Path of the converted glTF or glb file.',
type : 'string', type : 'string',
coerce : function (p) { coerce : function (p) {
if (!defined(p)) {
return undefined;
}
if (p.length === 0) { if (p.length === 0) {
throw new Error('Output path must be a file name'); throw new Error('Output path must be a file name');
} }