silverstripe / recipe-plugin

Helper plugin to install Silverstripe recipes
BSD 3-Clause "New" or "Revised" License
11 stars 10 forks source link

FIX Only write composer.json if there are changes #21

Closed andrewandante closed 2 years ago

andrewandante commented 2 years ago

Caught this on a deployment to one of our platforms, even though no changes were made, the file was still read into memory and rewritten. Unfortunately, that triggered this issue: https://github.com/composer/composer/issues/9515 with an empty "scripts": {} key being rewritten to "scripts": []

This doesn't totally fix it but it does prevent a few unnecessary writes and saves the day in that one use-case

GuySartorelli commented 2 years ago

Probably worth creating an issue for the underlying problem as well - we shouldn't be rewriting {} to [].

emteknetnz commented 2 years ago

@andrewandante 1.7.0