Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
* develop:
  Better output
  • Loading branch information
Jelle-S committed Mar 9, 2017
2 parents 6c3888b + 3bfa8cf commit 889c064
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Ssh.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ class Ssh extends BaseTask
*/
protected $physicalRemoteDir = false;

/**
* Stores ssh command output.
*
* @var string
*/
protected $output = '';

/**
* Creates a new Ssh task.
*
Expand Down Expand Up @@ -244,6 +251,8 @@ public function run()
$this->commandCallback($command['callback']),
]
);
$this->printTaskInfo($this->output);
$this->output = '';
if ($result === false || $ssh->getExitStatus() !== 0) {
$errorMessage .= sprintf(
'Could not execute %s on %s on port %s in folder %s with message: %s.',
Expand Down Expand Up @@ -283,7 +292,7 @@ protected function commandCallback($callback)
{
return (
function ($output) use ($callback) {
$this->printTaskInfo($output);
$this->output .= $output;
if (is_callable($callback)) {
return call_user_func($callback, $output);
}
Expand Down

0 comments on commit 889c064

Please sign in to comment.