mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 05:14:52 +08:00
Improve output formatting for update checks in CheckUpdateCommand
This commit is contained in:
parent
00c08e0c0c
commit
f7277cc012
@ -48,12 +48,10 @@ class CheckUpdateCommand extends BaseCommand
|
|||||||
foreach ($artifacts as $artifact) {
|
foreach ($artifacts as $artifact) {
|
||||||
$result = $downloader->checkUpdate($artifact, bare: $bare);
|
$result = $downloader->checkUpdate($artifact, bare: $bare);
|
||||||
if (!$result->needUpdate) {
|
if (!$result->needUpdate) {
|
||||||
$this->output->writeln("Artifact <info>{$artifact}</info> is already up to date (version: {$result->new})");
|
$this->output->writeln("Artifact <info>{$artifact}</info> is already up to date (<comment>{$result->new}</comment>)");
|
||||||
} else {
|
} else {
|
||||||
$this->output->writeln("<comment>Update available for artifact: {$artifact}</comment>");
|
|
||||||
[$old, $new] = [$result->old ?? 'unavailable', $result->new ?? 'unknown'];
|
[$old, $new] = [$result->old ?? 'unavailable', $result->new ?? 'unknown'];
|
||||||
$this->output->writeln(" Old version: <error>{$old}</error>");
|
$this->output->writeln("Update available for <info>{$artifact}</info>: <comment>{$old}</comment> -> <comment>{$new}</comment>");
|
||||||
$this->output->writeln(" New version: <info>{$new}</info>");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return static::OK;
|
return static::OK;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user