Norbert de Langen 005a37bee0 lint scripts
2024-06-07 10:09:02 +02:00

10 lines
269 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;
}