Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix an edge case when globbing the working dir #3

Merged
merged 3 commits into from
Jul 24, 2023

Conversation

bglw
Copy link
Contributor

@bglw bglw commented Jul 24, 2023

cloudcannon.config.yml

source: .
collections_config:
  docs:
    path: '.'
    glob: '**/*.md'

Currently this will return zero results (thecodrr/fdir#92).

This PR adds a workaround for this one case:

// Work around for https://github.com/thecodrr/fdir/issues/92
// Globbing on `.` doesn't work, so we crawl using the absolute CWD
// and get the relative paths of results instead of the base paths.
if ((crawlDirectory === '.' || crawlDirectory === './') && collectionConfig.glob) {
crawler = crawler.withRelativePaths();
crawlDirectory = process.cwd();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants