getkirby / cli

Kirby Command Line Interface
MIT License
51 stars 5 forks source link

Patch method 'json' #33

Closed S1SYPHOS closed 6 months ago

S1SYPHOS commented 1 year ago

Looking at the CLImate docs linked in README.md, one would expect that $cli->json($myJson) (eg inside a custom command) outputs JSON into the terminal - but all it does is return json_encoded data, which then needs to be output to the terminal, like this: $cli->out($cli->json($myJson)) - which is not desired behaviour from the looks of it.

In order to comply with aforementioned docs, this (monkey)patch solves this problem, although it may be further improved (I guess).

Cheers, S1SYPHOS

bastianallgeier commented 8 months ago

I've added more details to the issue https://github.com/getkirby/cli/issues/34