aboutsummaryrefslogtreecommitdiffstats
path: root/JSONSchema/validate.js
diff options
context:
space:
mode:
Diffstat (limited to 'JSONSchema/validate.js')
-rwxr-xr-xJSONSchema/validate.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/JSONSchema/validate.js b/JSONSchema/validate.js
index fa46ac39c..1a1a605db 100755
--- a/JSONSchema/validate.js
+++ b/JSONSchema/validate.js
@@ -4,6 +4,7 @@ var fs = require('fs');
var validate = require('jsonschema').validate;
var readline = require('readline');
+var schemaFile = process.argv[2];
var schema = '';
var testCode = '';
var success = true;
@@ -23,7 +24,7 @@ rl.on('line', function(line) {
});
rl.on('close', function() {
- schema = JSON.parse(fs.readFileSync('JSONSchema/schema.json'));
+ schema = JSON.parse(fs.readFileSync(schemaFile));
//sort file names alphabetically so that log output ordering is consistent
fileNames.sort(function(a,b) {
@@ -40,6 +41,7 @@ rl.on('close', function() {
try {
testCode = JSON.parse(fs.readFileSync(fileNames[i]));
} catch(e) {
+ console.log('error on file:', fileNames[i])
console.log(e);
numFailed++;
}