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: Windows file:\/\// -> file:[\/]+ #45

Closed
wants to merge 1 commit into from

Conversation

laggingreflex
Copy link
Contributor

@laggingreflex laggingreflex commented Nov 20, 2018

On Windows (edit: it seems this can be a case on other OSes too) there seems to be file:/// i.e. 3 forward slashes, whereas here it was only accounting for 2, leaving in an extra /

Fixes #41

Checklist
  • npm test, tests passing

    Weren't passing for me before this fix either.

npm run test:snap (to update the snapshot) shouldn't be needed
tests and/or benchmarks are included
~~ documentation is changed or added~~

On Windows there seems to be `file:///` i.e. 3 forward slashes, whereas here it was only accounting for 2, resul
@demurgos
Copy link
Contributor

demurgos commented Nov 20, 2018

This is more complicated than this, the path <-> URL conversion escapes some characters. For Windows, there are also server paths (UNC paths) and long paths (\\?\).

I wrote a utility library to convert between File URIs and system paths (furi) to solve this c8 issue. While writing it, I found some issues in Node support for file urls so I was waiting for it. I still need to add support for UNC paths (and some doc) but it should already be usable to fix this issue.

demurgos added a commit to demurgos/c8 that referenced this pull request Nov 21, 2018
This commit fixes the conversion from `file://` urls to system-dependent paths. It ensures that it works on Windows and with special characters.

- Closes bcoe#41
- Closes bcoe#45
@laggingreflex
Copy link
Contributor Author

#46 fixes it better. Closing

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.

c8 report doesn't work on Windows
2 participants