Skip to content

Commit

Permalink
🧑‍💻 Use OptimizeCommand::getOptimizedTasks when getting optimize ta…
Browse files Browse the repository at this point in the history
…sks (#425)
  • Loading branch information
Log1x authored Jan 18, 2025
1 parent e517a1a commit ecdce91
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
11 changes: 3 additions & 8 deletions src/Roots/Acorn/Console/Commands/OptimizeClearCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,9 @@ public function handle()
{
$this->components->info('Clearing cached bootstrap files.');

collect([
'cache' => fn () => $this->gracefulCallSilent('cache:clear') == 0,
'compiled' => fn () => $this->gracefulCallSilent('clear-compiled') == 0,
'config' => fn () => $this->gracefulCallSilent('config:clear') == 0,
'events' => fn () => $this->gracefulCallSilent('event:clear') == 0,
'routes' => fn () => $this->gracefulCallSilent('route:clear') == 0,
'views' => fn () => $this->gracefulCallSilent('view:clear') == 0,
])->each(fn ($task, $description) => $this->components->task($description, $task));
foreach ($this->getOptimizeClearTasks() as $description => $command) {
$this->components->task($description, fn () => $this->gracefulCallSilent($command) == 0);
}

$this->newLine();
}
Expand Down
9 changes: 3 additions & 6 deletions src/Roots/Acorn/Console/Commands/OptimizeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@ public function handle()
{
$this->components->info('Caching framework bootstrap, configuration, and metadata.');

collect([
'config' => fn () => $this->gracefulCallSilent('config:cache') == 0,
'events' => fn () => $this->gracefulCallSilent('event:cache') == 0,
'routes' => fn () => $this->gracefulCallSilent('route:cache') == 0,
'views' => fn () => $this->gracefulCallSilent('view:cache') == 0,
])->each(fn ($task, $description) => $this->components->task($description, $task));
foreach ($this->getOptimizeTasks() as $description => $command) {
$this->components->task($description, fn () => $this->gracefulCallSilent($command) == 0);
}

$this->newLine();
}
Expand Down

0 comments on commit ecdce91

Please sign in to comment.