Last active
March 17, 2017 10:17
-
-
Save cuter44/d6c2ffa15bbc26b5b4832f0cc8f5db2b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fl = [ | |
'./src/main/resources/acl.json', | |
'./src/main/resources/gru.json', | |
'./tmp/acl.json', | |
'./tmp/acl-live.json' | |
// append file to check here | |
]; | |
const fs = require('fs'); | |
const color = require('cli-color'); | |
const jsonlint = require('jsonlint'); | |
for (var fn of fl) | |
{ | |
try | |
{ | |
jsonlint.parse(fs.readFileSync(fn, "utf8")); | |
console.log(color.green("[OK]\t")+fn); | |
} | |
catch (ex) | |
{ | |
console.log(color.red("[ERROR]\t")+fn+"\n\t"+ex); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment