| 96 | } |
| 97 | |
| 98 | async function selectSourceFiles(inputDir: string, providerOption: string): Promise<string[]> { |
| 99 | const selected = parseCsv(providerOption); |
| 100 | |
| 101 | if (!selected.includes("all")) { |
| 102 | return selected.map((provider) => path.join(inputDir, `${provider}.yaml`)); |
| 103 | } |
| 104 | |
| 105 | const entries = await readdir(inputDir, { withFileTypes: true }); |
| 106 | return entries |
| 107 | .filter((entry) => entry.isFile() && /\.ya?ml$/i.test(entry.name)) |
| 108 | .map((entry) => path.join(inputDir, entry.name)) |
| 109 | .sort(); |
| 110 | } |
| 111 | |
| 112 | async function loadSourceProvider(filePath: string): Promise<SourceProvider> { |
| 113 | const raw = await readFile(filePath, "utf8"); |