feat(kit): support followSymbolicLinks option for resolveFiles (#6240)

This commit is contained in:
Conrawl Rogers 2022-08-02 08:25:35 -04:00 committed by GitHub
parent 94d0c08066
commit 8efaad43bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -151,7 +151,7 @@ async function isDirectory (path: string) {
return (await fsp.lstat(path)).isDirectory()
}
export async function resolveFiles (path: string, pattern: string | string[]) {
const files = await globby(pattern, { cwd: path, followSymbolicLinks: true })
export async function resolveFiles (path: string, pattern: string | string[], opts: { followSymbolicLinks?: boolean } = {}) {
const files = await globby(pattern, { cwd: path, followSymbolicLinks: opts.followSymbolicLinks ?? true })
return files.map(p => resolve(path, p)).filter(p => !isIgnored(p)).sort()
}