Closed
Description
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.
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.
- Removing
.withBasePath()
causes the files to be found - Removing the
glob(...)
causes all files in the current directory to be found.- I haven't found a glob that will return any results, including a more explicit
./**/*.txt
- I haven't found a glob that will return any results, including a more explicit
- Changing the path to
crawler.crawl("content")
orcrawler.crawl(process.cwd())
causes the files to be found- "./" also does not work as the directory
I'm on an M1 Macbook, for reference.
Metadata
Metadata
Assignees
Labels
No labels