2022-10-03 17:16:39 +11:00

11 lines
329 B
TypeScript

/* eslint-disable no-await-in-loop, no-restricted-syntax */
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;
}