Skip to content

Commit

Permalink
fix: windows paths
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperchupuDev committed Jul 17, 2024
1 parent 57a372b commit 3e610e7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const normalizeOptions = async (
}

if (Array.isArray(entry)) {
const matcher = picomatch(entry)
const matcher = picomatch(entry, { windows: process.platform === 'win32' })
options.entry = await new fdir()
.withRelativePaths()
.filter((file) => matcher(file))
Expand Down
1 change: 1 addition & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export async function removeFiles(patterns: string[], dir: string) {
const matcher = picomatch(matchPatterns, {
dot: true,
ignore: ignorePatterns,
windows: process.platform === 'win32',
})

const files = await new fdir()
Expand Down
2 changes: 1 addition & 1 deletion test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export async function run(
.withRelativePaths()
.crawl(path.resolve(testDir, 'dist'))
.withPromise()
.then((res) => res.sort())
.then((res) => res.map((f) => f.replaceAll('\\', '/')).sort())

return {
get output() {
Expand Down

0 comments on commit 3e610e7

Please sign in to comment.