From edb814c49a1c5cd44cd1119efa0fe568b25732c1 Mon Sep 17 00:00:00 2001 From: Bill Branan Date: Tue, 31 Aug 2021 15:59:09 -0400 Subject: [PATCH] Updates formatting to follow code style rules --- scripts/merge-i18n-files.ts | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/scripts/merge-i18n-files.ts b/scripts/merge-i18n-files.ts index f184b46217..e790828c0d 100644 --- a/scripts/merge-i18n-files.ts +++ b/scripts/merge-i18n-files.ts @@ -54,10 +54,9 @@ function parseCliInput() { process.exit(1); } fs.readdirSync(projectRoot(program.sourceDir)).forEach(file => { - if (fs.existsSync(program.outputDir + '/' + file) ) - { - console.log("Merging: "+ program.outputDir + '/' + file + ' with '+ program.sourceDir + '/' + file) - mergeFileWithSource(program.sourceDir + '/' + file, program.outputDir + '/' + file) + if (fs.existsSync(program.outputDir + '/' + file) ) { + console.log('Merging: ' + program.outputDir + '/' + file + ' with ' + program.sourceDir + '/' + file); + mergeFileWithSource(program.sourceDir + '/' + file, program.outputDir + '/' + file); } }); } else { @@ -79,21 +78,21 @@ function mergeFileWithSource(pathToSourceFile, pathToOutputFile) { const progressBar = new _cliProgress.SingleBar({}, _cliProgress.Presets.shades_classic); progressBar.start(100, 0); - const source_file = fs.readFileSync(pathToSourceFile, 'utf8') + const sourceFile = fs.readFileSync(pathToSourceFile, 'utf8'); progressBar.update(10); - const output_file = fs.readFileSync(pathToOutputFile, 'utf8') + const outputFile = fs.readFileSync(pathToOutputFile, 'utf8'); progressBar.update(20); - let parsed_source = JSON5.parse(source_file) + const parsedSource = JSON5.parse(sourceFile); progressBar.update(30); - let parsed_output = JSON5.parse(output_file) + const parsedOutput = JSON5.parse(outputFile); progressBar.update(40); - for (let key of Object.keys(parsed_source)) { - parsed_output[key] = parsed_source[key]; + for (const key of Object.keys(parsedSource)) { + parsedOutput[key] = parsedSource[key]; } progressBar.update(80); - fs.writeFileSync(pathToOutputFile,JSON5.stringify(parsed_output,{ space:'\n ', quote: '"' }), { encoding:'utf8' }) + fs.writeFileSync(pathToOutputFile,JSON5.stringify(parsedOutput,{ space:'\n ', quote: '"' }), { encoding:'utf8' }); progressBar.update(100); progressBar.stop();