From 6216711da66211147a8b438a8a14a76bcdf59525 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Tue, 28 Jul 2020 15:51:05 +1200 Subject: [PATCH] Re-enable stream logging for single-server deployments Show STDERR output when interactive commands are running --- composer.json | 2 +- src/Beam.php | 2 +- src/DeploymentProvider/Rsync.php | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 2164178..7c0f44d 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ }, "require-dev": { "phpunit/phpunit": "~5.0", - "mikey179/vfsStream": "~1.2", + "mikey179/vfsstream": "~1.2", "symfony/finder": "~2.2" }, "autoload": { diff --git a/src/Beam.php b/src/Beam.php index 6680c58..59976df 100644 --- a/src/Beam.php +++ b/src/Beam.php @@ -762,7 +762,7 @@ protected function doExecCommand($command, $outputHandler) if ($command['tty']) { - passthru(sprintf('%s; %s', + passthru(sprintf('%s; %s 2>&1', "cd {$this->getLocalPath()}", $command['command'] ), $exit); diff --git a/src/DeploymentProvider/Rsync.php b/src/DeploymentProvider/Rsync.php index 294850a..a6ba9b5 100644 --- a/src/DeploymentProvider/Rsync.php +++ b/src/DeploymentProvider/Rsync.php @@ -117,6 +117,8 @@ public function up(Closure $output = null, $dryrun = false, DeploymentResult $de /** @var DeploymentResult $mergedResult */ $mergedResult = null; $results = []; + // silent per-server output when collating multiple streams + $silent = count($this->getTargetPaths()) > 1; foreach ($this->getTargetPaths() as $server => $targetPath) { $result = $this->deploy( $this->buildCommand( @@ -125,7 +127,7 @@ public function up(Closure $output = null, $dryrun = false, DeploymentResult $de $dryrun ), $output, - true // silence per-server output + $silent ); $result->setName($server); $results[] = $result;