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

Add EOL when overwriting package.json #37

Closed
nexdrew opened this issue May 19, 2016 · 1 comment
Closed

Add EOL when overwriting package.json #37

nexdrew opened this issue May 19, 2016 · 1 comment

Comments

@nexdrew
Copy link
Member

nexdrew commented May 19, 2016

Otherwise changes to package.json b/w releases can end up flip-flopping the last line since editors like Atom will automatically add it but standard-version strips it off - just becomes annoying, unnecessary changes in history and in PRs.

I think we just need to change this line:

fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2), 'utf-8')

to something like this:

fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + require('os').EOL, 'utf-8')
@stevemao
Copy link
Member

Didn't know about require('os').EOL, I used to just use \n :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants