MCPcopy Create free account
hub / github.com/VPSDance/ai-proxy-rules / selectSourceFiles

Function selectSourceFiles

scripts/sync.ts:98–110  ·  view source on GitHub ↗
(inputDir: string, providerOption: string)

Source from the content-addressed store, hash-verified

96}
97
98async 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
112async function loadSourceProvider(filePath: string): Promise<SourceProvider> {
113 const raw = await readFile(filePath, "utf8");

Callers 1

syncFunction · 0.85

Calls 1

parseCsvFunction · 0.70

Tested by

no test coverage detected