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

fix: convert Windows path to posix path for globby #1197

Merged
merged 1 commit into from Sep 29, 2022

Conversation

imguolao
Copy link
Contributor

fix #1196

@rchl
Copy link

rchl commented Sep 29, 2022

There is a path.posix export in Node that sounds more appropriate to me that manual replace.
https://nodejs.org/api/path.html#pathposix

(Disclaimer: I know knowing about the issue at hand, just advocating for path.posix over manual replace)

@imguolao
Copy link
Contributor Author

There is a path.posix export in Node that sounds more appropriate to me that manual replace. https://nodejs.org/api/path.html#pathposix

(Disclaimer: I know knowing about the issue at hand, just advocating for path.posix over manual replace)

I think we should let @raineorshine decide.

@raineorshine
Copy link
Owner

raineorshine commented Sep 29, 2022

There is a path.posix export in Node that sounds more appropriate to me that manual replace.
nodejs.org/api/path.html#pathposix

Those are posix-specific versions of node's built-in path module, but in this case it is the external library globby that is the problem. There are no direct methods in node/posix for converting from Win32 to POSIX that I am aware of.

We use the simple replace elsewhere in the code to good effect:

// convert Windows path to *nix path for consistency
.replace(/\\/g, '/')

@raineorshine raineorshine merged commit 568f7d7 into raineorshine:main Sep 29, 2022
7 of 10 checks passed
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.

ncu -ws --root -i is not working in pnpm workspaces.
3 participants