improved version checker
This commit is contained in:
@ -43,7 +43,11 @@ class Update extends Command
|
||||
|
||||
$this->alias = $this->argument('alias');
|
||||
|
||||
$this->new = $this->getNewVersion();
|
||||
if (false === $this->new = $this->getNewVersion()) {
|
||||
$this->error('Not able to get the latest version of ' . $this->alias . '!');
|
||||
|
||||
return self::CMD_ERROR;
|
||||
}
|
||||
|
||||
$this->old = $this->getOldVersion();
|
||||
|
||||
@ -71,15 +75,7 @@ class Update extends Command
|
||||
|
||||
public function getNewVersion()
|
||||
{
|
||||
$new = $this->argument('new');
|
||||
|
||||
if ($new == 'latest') {
|
||||
$modules = ($this->alias == 'core') ? [] : [$this->alias];
|
||||
|
||||
$new = Versions::latest($modules)[$this->alias]->data->latest;
|
||||
}
|
||||
|
||||
return $new;
|
||||
return ($this->argument('new') == 'latest') ? Versions::latest($this->alias) : $this->argument('new');
|
||||
}
|
||||
|
||||
public function getOldVersion()
|
||||
|
Reference in New Issue
Block a user