()
| 114 | } |
| 115 | |
| 116 | async function mainThread() { |
| 117 | console.log("process.argv:", process.argv); |
| 118 | const database = new Database(LANGUAGE_DIR, LANGUAGE_SOURCE_FILE_NAME); |
| 119 | const scannedFiles = await scanCodeFiles(CODE_DIR, [], EXCLUDE_FILES); |
| 120 | console.log(`Scanned files (${INCLUDE_EXT_NAMES}):`, scannedFiles.length); |
| 121 | const promises = []; |
| 122 | for (let i = 0; i < scannedFiles.length; i += CONCURRENT_COUNT) { |
| 123 | const filesPath = scannedFiles.slice(i, i + CONCURRENT_COUNT); |
| 124 | promises.push(startThread(database.keysMap, filesPath, database)); |
| 125 | } |
| 126 | await Promise.all(promises); |
| 127 | console.log("Rewrite source lang file..."); |
| 128 | await database.rewriteSourceLangFile(); |
| 129 | console.log("Rewrite source lang file finished!"); |
| 130 | process.exit(0); |
| 131 | } |
| 132 | |
| 133 | async function worker() { |
| 134 | /** @type {Array<string>} */ |
no test coverage detected