Skip to content

Fix an edge case when globbing the working dir#3

Merged
rphillips-cc merged 3 commits intomainfrom
fix/glob-working-dir
Jul 24, 2023
Merged

Fix an edge case when globbing the working dir#3
rphillips-cc merged 3 commits intomainfrom
fix/glob-working-dir

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