File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -188,27 +188,23 @@ protected function passToRemoteProcessor(Task $task)
188
188
/**
189
189
* Display the given output line.
190
190
*
191
- * @param int $type
191
+ * @param string $type
192
192
* @param string $host
193
193
* @param string $line
194
194
* @return void
195
195
*/
196
196
protected function displayOutput ($ type , $ host , $ line )
197
197
{
198
- $ lines = explode ("\n" , $ line );
198
+ $ lines = array_filter ( array_map ( ' trim ' , explode ("\n" , $ line)) );
199
199
200
200
$ hostColor = $ this ->getHostColor ($ host );
201
201
202
202
foreach ($ lines as $ line ) {
203
- if (strlen ( trim ( $ line )) === 0 ) {
204
- continue ;
203
+ if ($ type === Process:: ERR ) {
204
+ $ line = ' <fg=red> ' . $ line . ' </> ' ;
205
205
}
206
206
207
- if ($ type == Process::OUT ) {
208
- $ this ->output ->write ($ hostColor .': ' .trim ($ line ).PHP_EOL );
209
- } else {
210
- $ this ->output ->write ($ hostColor .': ' .'<fg=red> ' .trim ($ line ).'</> ' .PHP_EOL );
211
- }
207
+ $ this ->output ->write ($ hostColor .': ' .$ line .PHP_EOL );
212
208
}
213
209
}
214
210
You can’t perform that action at this time.
0 commit comments