2024-08-15 10:26:24 +02:00

12 lines
283 B
TypeScript

import { pathExists } from 'fs-extra';
import { join } from 'path';
export async function findFirstPath(paths: string[], { cwd }: { cwd: string }) {
for (const filePath of paths) {
if (await pathExists(join(cwd, filePath))) {
return filePath;
}
}
return null;
}