VulpesOS/gaia/build/jsonlint.js
OverSu b38dea0597 Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
2026-09-30 23:13:03 +02:00

27 lines
662 B
JavaScript
Executable file

'use strict';
var utils = require('./utils');
var RE_JSON = /\.json$/;
exports.execute = function(options) {
var jsons = [];
var dirs = ['apps', 'dev_apps', 'build', 'customization', 'dev_apps',
'locales', 'shared'];
dirs.forEach(function(dir) {
var dirFile = utils.getFile(options.GAIA_DIR, dir);
var files = utils.ls(dirFile, true).filter(function(f) {
return RE_JSON.test(f.leafName);
});
jsons.push(...files);
});
jsons.forEach(function(json) {
try {
JSON.parse(utils.getFileContent(json));
} catch (e) {
utils.log('jsonlint', 'JSON lint error: ' + json.path + '\n');
throw e;
}
});
};