Closed fiasco closed 6 months ago
Also the case with api:applications:environment-list
I'm going to need more information to reproduce this. I can run acli api:applications:list
from any directory just fine (including ones with no composer.json, or composer.json without scripts), there's no PHP notice.
What does it mean to Use Symfony Process component
to run the process? That doesn't sound like a supported use case.
Is it possible that acli read into a local composer.json file it found? I can't reproduce this error now and I'm not exactly sure whats changed.
Oh, were you running the command with verbose output? That will output additional non-JSON text. That seems like expected behavior to me. I can't imagine how you'd output "verbose" JSON. I guess we could at least print another warning saying the output won't be JSON with verbose output, so people don't think this is a bug.
For posterity: here's the code that handles Composer hooks: https://github.com/acquia/cli/blob/main/src/EventListener/ComposerScriptsListener.php
In a nutshell:
--no-scripts
, nothing happens (I actually found a bug in this: https://github.com/acquia/cli/pull/1688 )Let me know if you need more help.
Describe the bug When post-acli-api-applications-list does not exist in composer.json a notice is echoed to stdout which breaks json formatting on api:applications:list calls. JQ does not seem affected by this, but attempting to decode this output in PHP fails.
To Reproduce
acli api:applications:list
getOutput
response tojson_decode
in PHP.null
instead of an application data object (or array).