Closed jbrada closed 2 years ago
The module uses the posix_isatty(STDOUT) method (in non development mode) to detect whether someone ran a command from the CLI or not.
posix_isatty(STDOUT)
It may happen (and it is my use case) that I want to keep the command's output but need to redirect it somewhere else.
For example: bin/magento jh-import:run import-name > output.txt Or use a third-party tool - like Rundeck or GoCD
In this case, the output is empty.
My pull-request changes the CLI detection method to PHP_SAPI=='cli' for reports and keeps the progress bar only for unredirected STDOUT.
PHP_SAPI=='cli'
It is such a nice improvement @jbrada! Thank you!
The module uses the
posix_isatty(STDOUT)
method (in non development mode) to detect whether someone ran a command from the CLI or not.It may happen (and it is my use case) that I want to keep the command's output but need to redirect it somewhere else.
For example: bin/magento jh-import:run import-name > output.txt Or use a third-party tool - like Rundeck or GoCD
In this case, the output is empty.
My pull-request changes the CLI detection method to
PHP_SAPI=='cli'
for reports and keeps the progress bar only for unredirected STDOUT.