saguijs / sagui

:monkey: Front-end tooling in a single dependency
http://sagui.js.org/
MIT License
669 stars 32 forks source link

Do not write package.json on install if content is the same #350

Closed ticolucci closed 7 years ago

ticolucci commented 7 years ago

While installing sagui, the post-install script will try to adjust make sure the scripts declared in package.json are updated. This is great on a fresh install, but not required on production deploys (where everything is already configured).

Therefore, do not change package.json when there is no change to be made.

(Related to #349 )

xaviervia commented 7 years ago

If I understand correctly, the issue is that Sagui rewrites the file even when there is no change?

pirelenito commented 7 years ago

Exactly! This is a great suggestion. And will probably solve the root issue of #349.

We will still need to improve the error logging there anyway. But it should no longer happen for @ticolucci `s reason.

pirelenito commented 7 years ago

see: https://github.com/saguijs/sagui/blob/v9/src/run/install/package-json.js