Skip to content

Commit

Permalink
Only run update command when there are outdated packages
Browse files Browse the repository at this point in the history
  • Loading branch information
tonysm committed Feb 3, 2024
1 parent 0728029 commit 2cb7fbd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Commands/UpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ class UpdateCommand extends Command

public function handle(Npm $npm)
{
$this->call('importmap:pin', [
'packages' => $npm->outdatedPackages()->pluck('name')->all(),
]);
if (count($outdatedPackages = $npm->outdatedPackages()) > 0) {
$this->call('importmap:pin', [
'packages' => $outdatedPackages->pluck('name')->all(),
]);
} else {
$this->components->info('No oudated packages found.');
}
}
}

0 comments on commit 2cb7fbd

Please sign in to comment.