Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

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

Merged
merged 4 commits into from
Aug 2, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/kit/src/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[], followSymbolicLinks: boolean = true) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please make 3rd argument an object { followSymbolicLinks }

const files = await globby(pattern, { cwd: path, followSymbolicLinks })
return files.map(p => resolve(path, p)).filter(p => !isIgnored(p)).sort()
}