Skip to content

Cannot create linux glob paths on windows machine even when specifying root dir #14

Open
@dsherret

Description

@dsherret

On windows machines, the following code:

toAbsoluteGlob("**/*.txt", { cwd: "/", root: "/" }))

Will output the following:

C:/**/*.txt

Expected: /**/*.txt

I'm thinking that perhaps the following:

if (rootDir) {
  rootDir = unixify(rootDir);
  if (process.platform === 'win32' || !isAbsolute(rootDir)) {
    rootDir = unixify(path.resolve(rootDir));
  }
}

Should maybe be changed to?

if (rootDir) {
  rootDir = unixify(rootDir);
  if (!isAbsolute(rootDir)) {
    rootDir = unixify(path.resolve(rootDir));
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions