From e5ea6d34c28a914009c125898f0661990ab2ad3a Mon Sep 17 00:00:00 2001 From: Superchupu <53496941+SuperchupuDev@users.noreply.github.com> Date: Wed, 17 Jul 2024 17:02:10 +0000 Subject: [PATCH] fix: windows paths --- src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 1917d0af1..aad26dd33 100644 --- a/src/index.ts +++ b/src/index.ts @@ -118,12 +118,13 @@ const normalizeOptions = async ( } if (Array.isArray(entry)) { - const matcher = picomatch(entry) - options.entry = await new fdir() + const matcher = picomatch(entry, { windows: true }) + const entries = await new fdir() .withRelativePaths() .filter((file) => matcher(file)) .crawl(process.cwd()) .withPromise() + options.entry = entries.map((f) => f.replaceAll(/\\/g, '/')) // Ensure entry exists if (!options.entry || options.entry.length === 0) { throw new PrettyError(`Cannot find ${entry}`)