1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-05 16:40:05 +01:00

Ignore output for commands using "> /dev/null 2>&1"

This commit is contained in:
Aryeh Raber
2020-04-26 22:53:30 +02:00
parent dedaddeff0
commit 9965f7614c

View File

@@ -68,10 +68,12 @@ function run($print, $plainText)
$output = $this->runCommand($command);
if ($this->ignoreOutput($command)) return;
$this->afterCommand($command, $output);
return compact('command', 'output');
});
})->filter()->values();
$output = $this->format($results, $plainText);
@@ -127,6 +129,11 @@ function afterCommand($command, $output)
}
}
function ignoreOutput($command)
{
return strpos($command, '> /dev/null 2>&1') !== false;
}
function format($results, $plainText)
{
return $results->map(function ($result) use ($plainText) {