Handle -i -o without following name

This commit is contained in:
Sean Lilley 2018-03-30 09:54:51 -04:00
parent bbdecdece2
commit 96b8d17009

View File

@ -128,6 +128,16 @@ if (defined(argv.metallicRoughnessOcclusionTexture) && defined(argv.specularGlos
var objPath = argv.input; var objPath = argv.input;
var gltfPath = argv.output; var gltfPath = argv.output;
if (objPath === '.') {
console.log('Input path is required');
return;
}
if (gltfPath === '.') {
console.log('Output path must be a filename');
return;
}
var filename = defaultValue(gltfPath, objPath); var filename = defaultValue(gltfPath, objPath);
var name = path.basename(filename, path.extname(filename)); var name = path.basename(filename, path.extname(filename));
var outputDirectory = path.dirname(filename); var outputDirectory = path.dirname(filename);