From 9b86b5a56eba7a2bb08d4dedf1b597110f1f3ecd Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Wed, 8 Sep 2021 14:36:46 -0400 Subject: Update dictionary validation script (#1937) --- dev/dictionary-validate.js | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/dev/dictionary-validate.js b/dev/dictionary-validate.js index 83889fc8..a21fa5cb 100644 --- a/dev/dictionary-validate.js +++ b/dev/dictionary-validate.js @@ -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 ...' - ].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 ...' + ].join('\n')); + return; + } + + await testDictionaryFiles(dictionaryFileNames); +} + + if (require.main === module) { main(); } module.exports = { getSchemas, - validateDictionary + validateDictionary, + testDictionaryFiles }; -- cgit v1.2.3