Update dictionary validation script (#1937)

This commit is contained in:
toasted-nutbread 2021-09-08 14:36:46 -04:00 committed by GitHub
parent ac12b50939
commit 9b86b5a56e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,16 +84,7 @@ function getSchemas() {
}
async function main() {
const dictionaryFileNames = process.argv.slice(2);
if (dictionaryFileNames.length === 0) {
console.log([
'Usage:',
' node dictionary-validate <dictionary-file-names>...'
].join('\n'));
return;
}
async function testDictionaryFiles(dictionaryFileNames) {
const schemas = getSchemas();
for (const dictionaryFileName of dictionaryFileNames) {
@ -114,10 +105,25 @@ async function main() {
}
async function main() {
const dictionaryFileNames = process.argv.slice(2);
if (dictionaryFileNames.length === 0) {
console.log([
'Usage:',
' node dictionary-validate <dictionary-file-names>...'
].join('\n'));
return;
}
await testDictionaryFiles(dictionaryFileNames);
}
if (require.main === module) { main(); }
module.exports = {
getSchemas,
validateDictionary
validateDictionary,
testDictionaryFiles
};