diff --git a/scripts/concatenateDocs.js b/scripts/concatenateDocs.js index 50c60ba7d..37e8745a0 100644 --- a/scripts/concatenateDocs.js +++ b/scripts/concatenateDocs.js @@ -1,9 +1,13 @@ +/* eslint no-console: "off" */ + const fs = require('fs'); const path = require('path'); // Check if the correct number of arguments are passed if (process.argv.length !== 4) { - console.log(`Usage: node ${path.basename(__filename)} `); + console.log( + `Usage: node ${path.basename(__filename)} `, + ); process.exit(1); } @@ -13,7 +17,9 @@ const outputFile = process.argv[3]; // Create or clear the output file fs.writeFileSync(outputFile, ''); -console.log(`Starting concatenation of md files from '${rootDirectory}' directory.`); +console.log( + `Starting concatenation of md files from '${rootDirectory}' directory.`, +); // Find all .md files and concatenate their contents function processDirectory(directory) { @@ -21,7 +27,10 @@ function processDirectory(directory) { const fullPath = path.join(directory, dirent.name); if (dirent.isDirectory() && !['node_modules'].includes(dirent.name)) { processDirectory(fullPath); - } else if (dirent.isFile() && ['.md', '.mdx'].includes(path.extname(dirent.name))) { + } else if ( + dirent.isFile() && + ['.md', '.mdx'].includes(path.extname(dirent.name)) + ) { console.log(`Adding file: ${fullPath}`); const data = fs.readFileSync(fullPath, 'utf8'); fs.appendFileSync(outputFile, `File: ${fullPath}\n\n${data}\n`);