tool that can be expanded for updating composer.json
with one-liners
it currently can add items to the repositories
array and to the scripts
object
we use it like:
ddev exec 'bash -c "$(curl -fsSL https://raw.githubusercontent.com/cherryhill/edit-composer-json/main/insert)" repository cherryhill/example-custom-project'
to get:
{
"repositories": [
{
"type": "github",
"url": "https://github.com/cherryhill/example-custom-project"
}
]
}
and:
ddev exec 'bash -c "$(curl -fsSL https://raw.githubusercontent.com/cherryhill/edit-composer-json/main/insert)" script post-update-cmd ./vendor/cherryhill/example-custom-project/executable-command'
to get:
{
"scripts": {
"post-update-cmd": "./vendor/cherryhill/example-custom-project/executable-command"
}
}