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

Infer EOLs from existing file or use OS EOL #1911

Merged
merged 1 commit into from
Nov 17, 2016
Merged

Infer EOLs from existing file or use OS EOL #1911

merged 1 commit into from
Nov 17, 2016

Conversation

iredchuk
Copy link
Contributor

Summary

Yarn uses UNIX line endings on all systems when writing lock file. We want to solve this problem as described in #1061: infer line endings from the existing file, and if it does not exist, use the system default.

Test plan

On a UNIX system, in an empty directory:
$ yarn add <some_package>
$ cat -e yarn.lock
You should only see LF line endings.
$ unix2dos yarn.lock
$ yarn add <some_other_package>
$ cat -e yarn.lock
You should only see CRLF line endings.

On a Windows system, in an empty directory:
$ yarn add <some_package>
$ cat.exe -e yarn.lock
You should only see CRLF line endings.
$ dos2unix.exe yarn.lock
$ yarn add <some_other_package>
$ cat -e yarn.lock
You should only see LF line endings.

* When writing lockfile, yarnrc or manifest file, keep line endings as in existing file
* Implemented as proposed by @ahelmberger
* Resolves #1061
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