Skip to content

Commit

Permalink
Merge pull request #9 from worksome/feature/quiet-output
Browse files Browse the repository at this point in the history
feat: add support for quiet output
  • Loading branch information
owenvoke authored Aug 16, 2024
2 parents 1294aaa + 0f5c484 commit e0f2bbb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/DatabaseDumpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\StreamOutput;
use Worksome\Foggy\DumpProcess;

Expand All @@ -29,7 +31,11 @@ public function handle(): void
? new StreamOutput(fopen($this->option('output'), 'w'))
: $this->getOutput()->getOutput();

$consoleOutput = $this->option('output') ? $this->getOutput()->getOutput() : null;
$consoleOutput = match (true) {
$this->option('output') && $this->option('quiet') => new ConsoleOutput(OutputInterface::VERBOSITY_QUIET),
$this->option('output') => $this->getOutput()->getOutput(),
default => null,
};

$process = new DumpProcess(
DB::connection($this->option('connection'))->getDoctrineConnection(),
Expand Down

0 comments on commit e0f2bbb

Please sign in to comment.