lerna-script icon indicating copy to clipboard operation
lerna-script copied to clipboard

Prevent deps:sync from touching unmodified package.json

Open Enrice opened this issue 4 years ago • 1 comments

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 avatar Jun 03 '20 09:06 Enrice

..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.

Enrice avatar Jun 03 '20 15:06 Enrice