Describe the bug
In apps:builds:create, the deployment step (triggered by --channel or --destination) runs after the final JSON document has been printed. The delegated apps:deployments:create action then writes its own output to stdout, which lands after the JSON.
Consumers that parse the JSON tail of the command output (for example the cloud-build-action, which extracts it with sed -n '/^{/,$p' | jq) receive invalid input when --json is combined with --channel or --destination, because the JSON document is followed by non-JSON lines.
Steps to reproduce
- Run
npx @capawesome/cli apps:builds:create --app-id <id> --platform web --channel <channel> --json --yes
- Wait for the build to complete.
- Observe stdout: the JSON document is printed first, followed by the deployment output.
Expected behavior
The JSON document is the last thing written to stdout so the output tail is always parseable.
Possible fix
Run the deployment delegation before printing the final JSON (mirroring how the share step is ordered), and/or include the deployment result in the JSON output.
Affected code
src/commands/apps/builds/create.ts — the deployment delegation at the end of the action runs after the --json output block.
Describe the bug
In
apps:builds:create, the deployment step (triggered by--channelor--destination) runs after the final JSON document has been printed. The delegatedapps:deployments:createaction then writes its own output to stdout, which lands after the JSON.Consumers that parse the JSON tail of the command output (for example the
cloud-build-action, which extracts it withsed -n '/^{/,$p' | jq) receive invalid input when--jsonis combined with--channelor--destination, because the JSON document is followed by non-JSON lines.Steps to reproduce
npx @capawesome/cli apps:builds:create --app-id <id> --platform web --channel <channel> --json --yesExpected behavior
The JSON document is the last thing written to stdout so the output tail is always parseable.
Possible fix
Run the deployment delegation before printing the final JSON (mirroring how the share step is ordered), and/or include the deployment result in the JSON output.
Affected code
src/commands/apps/builds/create.ts— the deployment delegation at the end of the action runs after the--jsonoutput block.