isaacs / isaacs/node-glob

Platform independent way of referring to root?

Open
#592 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
8.7k
Forks
538
PR merge metrics
No merged PRs in 30d

Description

I would like to refer to a root folder in my ignore globs in a platform independent way. I assumed that I could use the glob '/exclude/**' but unfortunately, that doesn't work on Windows.

On Windows, I need to use '//?/C:/exclude/**', I would prefer to use '/exclude/**' on both Windows and Linux.

What is odd is that include globs starting with '/' to refer to the root work fine on Windows, it only doesn't work for ignore globs.

Are there any GlobOptions I'm overlooking that will allow '/exclude/**' to work on Windows?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with GlobOptions and the ignore-glob handling for patterns beginning with '/'; compare it with include-glob root handling on Windows. Reproduce '/exclude/' and '//?/C:/exclude/' on Windows, then verify that '/exclude/**' consistently refers to the root for ignore globs on Windows and Linux.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.