From d28ba6e2e50208c7f9a8f6f6dc28a32ec2986d47 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 60f3dc2..fd3b389 100644 --- a/src/NewCommand.php +++ b/src/NewCommand.php @@ -879,7 +879,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; @@ -935,7 +935,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; } /**