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

feat: support MS Windows paths #1

Merged
merged 10 commits into from Feb 14, 2020
Merged

feat: support MS Windows paths #1

merged 10 commits into from Feb 14, 2020

Conversation

@zeke
Copy link
Contributor

zeke commented Feb 1, 2020

This PR adds support for Windows-style filename paths. It also replaces the Travis CI config with an Actions workflow to run the tests on Ubuntu and Windows.

Note: This project is not set up with semantic-release yet, so it will need to be manually published to the registry using npx np minor semantic-release was set up in #2, so merging this PR should trigger an automatic release to npm.

Inspired by github/help-docs#11989

cc @sarahs @rachmari

@zeke zeke requested a review from sarahs Feb 1, 2020
zeke added 3 commits Feb 1, 2020
@zeke zeke changed the title support MS Windows paths feat: support MS Windows paths Feb 1, 2020
zeke added 5 commits Feb 1, 2020

// slash at the beginning of a filename
const pathSeparator = new RegExp(path.sep, 'g')
const leadingPathSeparator = new RegExp(`^${escapeRegExp(path.sep)}`)
const windowsLeadingPathSeparator = new RegExp('^/')

This comment has been minimized.

Copy link
@juliangruber

juliangruber Feb 3, 2020

isn't this covered by applying leadingPathSeparator already? And on windows there shouldn't be any paths that use /

This comment has been minimized.

Copy link
@zeke

zeke Feb 3, 2020

Author Contributor

You would think! But then the tests didn't pass until I added the additional windowsLeadingPathSeparator replacement as well, because the result ended up being .foo.bar.baz instead of foo.bar.baz on Windows. 🤷‍♂

@sarahs
sarahs approved these changes Feb 11, 2020
@zeke zeke merged commit 949a7b7 into master Feb 14, 2020
3 checks passed
3 checks passed
build (ubuntu-latest)
Details
build (windows-latest)
Details
Semantic Pull Request ready to be squashed
Details
@zeke zeke deleted the support-ms-windows-paths branch Feb 14, 2020
@github-actions

This comment has been minimized.

Copy link

github-actions bot commented Feb 14, 2020

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot added the released label Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.