mirror of
https://github.com/laravel/valet.git
synced 2026-02-06 16:50:09 +01:00
Add --print flag to print output while diagnostics are running
This commit is contained in:
@@ -54,11 +54,17 @@ function __construct(CommandLine $cli, Filesystem $files)
|
||||
/**
|
||||
* Run diagnostics.
|
||||
*/
|
||||
function run()
|
||||
function run($print)
|
||||
{
|
||||
$result = collect($this->commands)->map(function ($command) {
|
||||
$result = collect($this->commands)->map(function ($command) use ($print) {
|
||||
$output = $this->cli->runAsUser($command);
|
||||
|
||||
if ($print) {
|
||||
output(str_repeat('-', 25));
|
||||
info("$ $command");
|
||||
output(trim($output));
|
||||
}
|
||||
|
||||
return implode(PHP_EOL, ["$ $command", trim($output)]);
|
||||
})->implode(PHP_EOL.str_repeat('-', 25).PHP_EOL);
|
||||
|
||||
|
||||
@@ -537,13 +537,15 @@
|
||||
/**
|
||||
* Output diagnostics to aid in debugging Valet.
|
||||
*/
|
||||
$app->command('diagnose', function () {
|
||||
$app->command('diagnose [-p|--print]', function ($print) {
|
||||
info('Running diagnostics...');
|
||||
|
||||
Diagnose::run();
|
||||
Diagnose::run($print);
|
||||
|
||||
info('Diagnostics output has been copied to your clipboard.');
|
||||
})->descriptions('Output diagnostics to aid in debugging Valet.');
|
||||
})->descriptions('Output diagnostics to aid in debugging Valet.', [
|
||||
'--print' => 'print diagnostics output while running'
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user