fixes for broken gpm selfupgrade

This commit is contained in:
Andy Miller
2015-04-08 22:29:50 -06:00
parent 071989c554
commit b3a9d7cd41
2 changed files with 5 additions and 7 deletions

View File

@@ -38,7 +38,7 @@ class Grav extends AbstractPackageCollection
*/
public function getAssets()
{
return $this->data->assets;
return $this->data['assets'];
}
/**
@@ -50,11 +50,11 @@ class Grav extends AbstractPackageCollection
public function getChangelog($diff = null)
{
if (!$diff) {
return $this->data->changelog;
return $this->data['changelog'];
}
$diffLog = [];
foreach ($this->data->changelog as $version => $changelog) {
foreach ($this->data['changelog'] as $version => $changelog) {
preg_match("/[\d\.]+/", $version, $cleanVersion);
if (!$cleanVersion || version_compare($diff, $cleanVersion[0], ">=")) { continue; }

View File

@@ -84,7 +84,7 @@ class SelfupgradeCommand extends Command
$this->setupConsole($input, $output);
$this->upgrader = new Upgrader($this->input->getOption('force'));
$update = $this->upgrader->getAssets()['grav-update'];
$local = $this->upgrader->getLocalVersion();
$remote = $this->upgrader->getRemoteVersion();
@@ -95,8 +95,6 @@ class SelfupgradeCommand extends Command
exit;
}
$update = $this->upgrader->getAssets()->{'grav-update'};
$questionHelper = $this->getHelper('question');
$skipPrompt = $this->input->getOption('all-yes');
@@ -141,7 +139,7 @@ class SelfupgradeCommand extends Command
$this->output->writeln("");
$this->output->writeln("Preparing to upgrade to v<cyan>$remote</cyan>..");
$this->output->write(" |- Downloading upgrade [" . $this->formatBytes($update->size) . "]... 0%");
$this->output->write(" |- Downloading upgrade [" . $this->formatBytes($update['size']) . "]... 0%");
$this->file = $this->download($update);
$this->output->write(" |- Installing upgrade... ");