forked from Food-Static-Data/sd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jsonlint.config.js
33 lines (29 loc) · 948 Bytes
/
jsonlint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// at this file we'll run nodejs command
var shell = require('shelljs')
const _ = require('lodash')
// @TODO add here all new generated at generator files too
// @TODO looks like jsonlint doesnt called without build... strange
const jsonFiles = require('./src/files.js')
// each can be used instead of forEach
// @TODO replace with lodash
_.forEach(Object.keys(jsonFiles), function (key) {
try {
shell.exec('jsonlint ' + jsonFiles[key], { silent: true })
} catch (e) {
console.log(e)
}
// // Run external tool synchronously
// if (shell.exec('git commit -am "Auto-commit"').code !== 0) {
// shell.echo('Error: Git commit failed');
// shell.exit(1);
// }
})
// Check if path exist
// @TODO lodash
Object.keys(jsonFiles).forEach(function (key) {
if (shell.test('-e', jsonFiles[key])) {
// console.log("File exist " + jsonFiles[key]);
} else {
// console.log("File doesn't exist " + jsonFiles[key]);
}
})