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

Always use slash as join separator for glob patterns #18

Merged
merged 1 commit into from Jun 27, 2019

Conversation

yhatt
Copy link
Contributor

@yhatt yhatt commented Jun 27, 2019

Fixes #17.

@sindresorhus sindresorhus changed the title Use always slash as join separator for glob patterns Always use slash as join separator for glob patterns Jun 27, 2019
@sindresorhus sindresorhus merged commit 0c86837 into kevva:master Jun 27, 2019
@yhatt yhatt deleted the fix-join-separator branch June 27, 2019 10:40
@@ -6,7 +6,7 @@ const getExtensions = extensions => extensions.length > 1 ? `{${extensions.join(

const getPath = (filepath, cwd) => {
const pth = filepath[0] === '!' ? filepath.slice(1) : filepath;
return path.isAbsolute(pth) ? pth : path.join(cwd, pth);
return path.isAbsolute(pth) ? pth : path.posix.join(cwd, pth);
Copy link
Contributor Author

@yhatt yhatt Jun 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While debugging sindresorhus/globby#126, I found out using path.posix.join in this line is to excess.

A returned path by getPath() is used only for check whether there is a directory (via path-type). Thus, it must join by OS-specific separator for returning correct path.

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.

Generated patterns in Windows are incompatible with micromatch
2 participants