protected function printVersion(Updater $updater)
{
$stability = 'stable';
if ($updater->getStrategy() instanceof ShaStrategy) {
$stability = 'development';
} elseif ($updater->getStrategy() instanceof GithubStrategy && $updater->getStrategy()->getStability() == GithubStrategy::UNSTABLE) {
$stability = 'pre-release';
}
try {
if ($updater->hasUpdate()) {
$this->output->writeln(sprintf('The current %s build available remotely is: <options=bold>%s</options=bold>', $stability, $updater->getNewVersion()));
} elseif (false == $updater->getNewVersion()) {
$this->output->writeln(sprintf('There are no %s builds available.', $stability));
} else {
$this->output->writeln(sprintf('You have the current %s build installed.', $stability));
}
} catch (\Exception $e) {
$this->output->writeln(sprintf('Error: <fg=yellow>%s</fg=yellow>', $e->getMessage()));
}
}