From 520db26ed2d95d51c34d6ebad8d32200745c534d Mon Sep 17 00:00:00 2001 From: Jonathon Byrdziak Date: Fri, 20 Mar 2026 18:39:09 -0700 Subject: [PATCH] Stream composer and submodule output live in verbose mode In verbose mode (-v), use passthru() instead of Shell::run() for composer install and git submodule update so output streams to the terminal in real time. Also adds timeout 120 and --no-interaction to composer install to prevent hangs. Co-Authored-By: Claude Opus 4.6 --- src/Commands/ComposerInstall.php | 11 +++++++++-- src/Commands/GitPull.php | 13 +++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/Commands/ComposerInstall.php b/src/Commands/ComposerInstall.php index c57ce44..e1c2342 100644 --- a/src/Commands/ComposerInstall.php +++ b/src/Commands/ComposerInstall.php @@ -100,8 +100,15 @@ protected function execute(InputInterface $input, OutputInterface $output): int . " --ignore-platform-reqs" . " --no-interaction" . " --no-ansi"; - $response = Shell::run($command, $return_var); - if ($response) $output->writeln($response); + + if ($output->isVerbose()) { + // Stream output live so hangs are visible + $output->writeln(" > {$command}"); + passthru($command . " 2>&1", $return_var); + } else { + $response = Shell::run($command, $return_var); + if ($response) $output->writeln($response); + } if ($return_var) { $output->writeln("Composer install failed (exit code {$return_var})"); } diff --git a/src/Commands/GitPull.php b/src/Commands/GitPull.php index bc55315..cfab3de 100644 --- a/src/Commands/GitPull.php +++ b/src/Commands/GitPull.php @@ -157,10 +157,15 @@ protected function execute(InputInterface $input, OutputInterface $output): int // Update the submodules $logMsg("running submodule update"); - $command = "GIT_TERMINAL_PROMPT=0 timeout 60 git -C " . escapeshellarg($repo_dir) . " submodule update --init --recursive"; - $response = Shell::run($command); - $logMsg("submodule update done"); - if ($response) $output->writeln($response); + $submoduleCmd = "{$envPrefix} timeout 60 git -C " . escapeshellarg($repo_dir) . " submodule update --init --recursive"; + if ($output->isVerbose()) { + $output->writeln(" > {$submoduleCmd}"); + passthru($submoduleCmd . " 2>&1", $subReturn); + } else { + $response = Shell::run($submoduleCmd, $subReturn); + if ($response) $output->writeln($response); + } + $logMsg("submodule update done exit={$subReturn}"); return Command::SUCCESS; }