From 0c0e79b816aed6e03242424f582c1526f888d706 Mon Sep 17 00:00:00 2001 From: Francisco Madeira Date: Wed, 29 May 2024 00:16:58 +0100 Subject: [PATCH] Keep the same output if the spinner is not available. --- src/NewCommand.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/NewCommand.php b/src/NewCommand.php index d4864a0..8d7f228 100644 --- a/src/NewCommand.php +++ b/src/NewCommand.php @@ -874,7 +874,7 @@ protected function runCommands($commands, InputInterface $input, OutputInterface }, $commands); } - if (! $output->isVerbose()) { + if (! $output->isVerbose() && $this->canUseSpinner($input, $output)) { $commands = array_map(function ($value) { if (str_starts_with($value, 'chmod')) { return $value; @@ -930,7 +930,11 @@ protected function runCommand(string $command, InputInterface $input, OutputInte } } - return tap($process)->run(); + $process->run(function ($type, $line) use ($output) { + $output->write(' '.$line); + }); + + return $process; } /**