wix-incubator / lerna-script

Lerna addon for adding custom tasks
MIT License
164 stars 13 forks source link

Prevent deps:sync from touching unmodified package.json #411

Open Enrice opened 4 years ago

Enrice commented 4 years ago

If deps:sync hasn't actually changed a package.json, it would be much nicer not to rewrite the file at all, just leave it as is, so git wouldn't see a change. The reason seems to be an added "0d" character at the end.

Enrice commented 4 years ago

..which in turn is caused by having git config core.autocrlf=input on Windows. Whereas writing the parsed json did write LF characters at the end of each line, the last line break was CR/LF due to EOL being CRLF on Windows. So this is not in sync.