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

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

Open
dsherret opened this issue Mar 7, 2018 · 3 comments

Comments

@dsherret
Copy link

dsherret commented Mar 7, 2018

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));
  }
}
@dsherret
Copy link
Author

dsherret commented Mar 7, 2018

See my commit here. This might be considered a change of behaviour, but this allows for linux globs to be created on windows:

dsherret@7ca9987

@jonschlinkert
Copy link
Member

want to do a PR so we can review?

@dsherret
Copy link
Author

@jonschlinkert done. I opened #16.

There was one slight issue with it a day ago on the linux CI, but it's good now.

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

No branches or pull requests

2 participants