Closed bglw closed 1 year ago
I have a weird case narrowed down where using a glob, a crawl path of ., and the withBasePath option together causes no results to be returned.
.
withBasePath
Reproduction setup:
npm init -y npm pkg set type="module" npm i fdir picomatch mkdir content touch content/file1.txt touch content/file2.txt
Reproduction js:
import { fdir } from "fdir"; const run = async () => { const crawler = new fdir().withBasePath(); crawler.glob("**/*.txt"); const files = await crawler.crawl(".").withPromise(); console.log(files); }; run();
This will log out (on my machine) [].
[]
This only occurs when all three options are configured as so.
.withBasePath()
glob(...)
./**/*.txt
crawler.crawl("content")
crawler.crawl(process.cwd())
I'm on an M1 Macbook, for reference.
Hi, thanks for reporting this issue! I will take a look at this ASAP.
I have a weird case narrowed down where using a glob, a crawl path of
.
, and thewithBasePath
option together causes no results to be returned.Reproduction setup:
Reproduction js:
This will log out (on my machine)
[]
.This only occurs when all three options are configured as so.
.withBasePath()
causes the files to be foundglob(...)
causes all files in the current directory to be found../**/*.txt
crawler.crawl("content")
orcrawler.crawl(process.cwd())
causes the files to be foundI'm on an M1 Macbook, for reference.