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

Normalize \\ paths to / on windows based systems. Makes all tests pass #2

Merged
merged 2 commits into from
Mar 4, 2020

Conversation

Havunen
Copy link
Contributor

@Havunen Havunen commented Mar 4, 2020

Fixes github #1

NodeJS resolve returns \ for paths in windows based systems and / for posix. This PR fixes the failed tests in this repository when running on windows.

This is the problem:

path.join('foo', '..', 'bar', 'baz/foo');
// 'bar/baz/foo' on OSX and Linux
// 'bar\\baz\\foo' on Windows
path.resolve('../', '/../', '../')
// '/home' on Linux
// '/Users' on OSX
// 'C:\\Users' on Windows

See https://shapeshed.com/writing-cross-platform-node/

@joshuajaco joshuajaco added bug Something isn't working good first issue Good for newcomers labels Mar 4, 2020
lib/utils.js Outdated Show resolved Hide resolved
@joshuajaco joshuajaco merged commit b289149 into joshuajaco:master Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants