Commit ff13fca8 authored by Isuru Liyanage's avatar Isuru Liyanage
Browse files

fix glob file add error

parent 4a156f1f
......@@ -7,7 +7,7 @@ class BioValidatorCLI {
constructor(pathToSchema, pathToJson, pathToRefSchema) {
this.pathToSchema = pathToSchema
this.pathToJson = pathToJson
this.pathToRefSchema = pathToRefSchema;
this.biovalidator = new BioValidator(pathToRefSchema);
}
read_schema(pathToSchema) {
......@@ -33,10 +33,9 @@ class BioValidatorCLI {
validate() {
this.inputSchema = this.read_schema(this.pathToSchema)
this.jsonToValidate = this.read_json(this.pathToJson)
let biovalidator = new BioValidator(this.pathToRefSchema);
if (this.inputSchema && this.jsonToValidate) {
biovalidator.runValidation(this.inputSchema, this.jsonToValidate).then((output) => {
this.biovalidator.runValidation(this.inputSchema, this.jsonToValidate).then((output) => {
logger.log("silly", "Sent validation results.");
this.process_output(output);
}).catch((error) => {
......
......@@ -184,6 +184,7 @@ class BioValidator {
cachedSchemas[uri] = loadedSchema;
resolve(loadedSchema);
}).catch(err => {
console.log("Failed to retrieve remote schema: " + uri)
reject(err);
});
});
......
......@@ -25,7 +25,7 @@ function readFile(filePath) {
function addFiles(filePattern, files) {
if (glob.hasMagic(filePattern)) {
const dataFiles = glob.sync(filePattern, {cwd: process.cwd()})
files = files.concat(dataFiles);
files.push(...dataFiles);
} else {
if (fs.lstatSync(filePattern).isDirectory()) {
fs.readdirSync(filePattern).forEach(file => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment