mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-21 05:02:39 +08:00
11 lines
329 B
TypeScript
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;
|
|
}
|