Skip to content

Commit f5b2dec

Browse files
committed
feat: display version difference with cli out of date warning
1 parent 66fee28 commit f5b2dec

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/EventListener/VersionCheckSubscriber.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ public function onConsoleCommand(ConsoleCommandEvent $event)
7979
$this->cliConfiguration->setGitHubLastCheckedTimestamp($time);
8080
}
8181

82-
if (version_compare($this->cliConfiguration->getGitHubCliVersion(), $this->version, '>')) {
83-
$event->getOutput()->writeln('<comment>A new version of the Ymir CLI is available</comment>');
82+
$latestVersion = $this->cliConfiguration->getGitHubCliVersion();
83+
84+
if (version_compare($latestVersion, $this->version, '>')) {
85+
$event->getOutput()->writeln(sprintf('<comment>A new version of the Ymir CLI is available:</comment> <info>%s</info> → <info>%s</info>', $this->version, $latestVersion));
8486
}
8587
}
8688

0 commit comments

Comments
 (0)