* Process feature conversion for a single feature type * @param processor - The processor to use for loading and converting files * @param outputDir - Output directory for converted files * @returns The paths of converted files
(params: {
processor: FeatureProcessor;
outputDir: string;
})
| 103 | * @returns The paths of converted files |
| 104 | */ |
| 105 | async function processFeatureConversion(params: { |
| 106 | processor: FeatureProcessor; |
| 107 | outputDir: string; |
| 108 | }): Promise<{ paths: string[] }> { |
| 109 | const { processor, outputDir } = params; |
| 110 | const paths: string[] = []; |
| 111 | |
| 112 | const toolFiles = await processor.loadToolFiles(); |
| 113 | if (toolFiles.length === 0) { |
| 114 | return { paths: [] }; |
| 115 | } |
| 116 | |
| 117 | const rulesyncFiles = await processor.convertToolFilesToRulesyncFiles(toolFiles); |
| 118 | for (const file of rulesyncFiles) { |
| 119 | const relativePath = join(file.getRelativeDirPath(), file.getRelativeFilePath()); |
| 120 | const outputPath = join(outputDir, relativePath); |
| 121 | await writeFileContent(outputPath, file.getFileContent()); |
| 122 | paths.push(relativePath); |
| 123 | } |
| 124 | |
| 125 | return { paths }; |
| 126 | } |
| 127 | |
| 128 | /** |
| 129 | * Convert fetched tool-specific files to rulesync format |
no test coverage detected
searching dependent graphs…