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

Replace backslashes with forward slashes for filepaths on Windows #17279

Merged
merged 2 commits into from
Aug 9, 2022

Conversation

queengooborg
Copy link
Contributor

This should fix the issue reported by @hamishwillee in #17278 (comment).

@github-actions github-actions bot added the linter Issues or pull requests regarding the tests / linter of the JSON files. label Aug 9, 2022
@hamishwillee
Copy link
Contributor

@queengooborg Exactly same behaviour as before: ran npm install then npm test

@queengooborg
Copy link
Contributor Author

Argh... I don't have a way to try out things in Windows, but it's definitely something that's related to the filepaths.

test/lint.ts Outdated
filePath.category = filePath.full.split(path.sep)[0];
if (path.sep !== '/') {
// Normalize file paths for Windows users
filePath.full = filePath.full.replace(path.sep, '/');
Copy link
Contributor

Choose a reason for hiding this comment

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

@queengooborg I added some crappy logging . It seems to be showing that this only replaces the first separator, and you have several.

Before replace: webextensions\manifest\storage.json 
After replace: webextensions/manifest\storage.json 

Could this be the cause? If not, add logging where you need and I'll run this for you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ack, right, I forgot that JavaScript's .replace() function is dumb... 🤦‍♀️

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, lets move to Python for all of this :-)

Copy link
Contributor

@hamishwillee hamishwillee left a comment

Choose a reason for hiding this comment

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

Fix is good thanks. I can't merge though :-)

@queengooborg queengooborg merged commit f5c35d3 into mdn:main Aug 9, 2022
@queengooborg queengooborg deleted the linter/filepaths branch August 9, 2022 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linter Issues or pull requests regarding the tests / linter of the JSON files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants