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 #5517: Backlashes in output fail for escape sequences in Windows #5792

Merged
merged 2 commits into from
May 13, 2018
Merged

Fix #5517: Backlashes in output fail for escape sequences in Windows #5792

merged 2 commits into from
May 13, 2018

Conversation

antrancs
Copy link
Contributor

@antrancs antrancs commented May 6, 2018

This is my very first PR. So if there's any suggestions or if I'm missing anything, please advise 😀

Summary
This is the fix for #5517 where backlashes in the output in Windows are broken if the directory path contains "\n". The stringifyLangArgs method has been modified so that "\n" will only be replaced by EOL if it is not preceded by a "\".

Test plan
The test project path is C:\Users\An\Documents\Projects\oss\name
Before

error An unexpected error occurred: "C:\\Users\\An\\Documents\\Projects\\oss\ 
ame\\package.json: Unexpected token U in JSON at position 139". 

After

error An unexpected error occurred: "C:\\Users\\An\\Documents\\Projects\\oss\\name\\package.json: Unexpected token U in JSON at position 139". 

Also added automated tests.

@BYK
Copy link
Member

BYK commented May 9, 2018

If you can add a test case for it, I think the PR is good to go :)

Thanks a lot!

@BYK BYK self-requested a review May 9, 2018 11:10
Copy link
Member

@BYK BYK left a comment

Choose a reason for hiding this comment

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

Let's add tests for this.

Also a comment in the new function, explaining why and using descriptive variable names instead of $0 and $1 would be great.

@antrancs
Copy link
Contributor Author

antrancs commented May 10, 2018

@BYK : Thanks for the review :D. I just updated the function and added tests for it.

Copy link
Member

@BYK BYK left a comment

Choose a reason for hiding this comment

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

Nice!

@BYK BYK merged commit d28f8e5 into yarnpkg:master May 13, 2018
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.

2 participants