From 6992d52767ae024ff231e32a10e65b914e0ea3e0 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Wed, 20 Jan 2021 10:33:11 +0200 Subject: [PATCH] Fixed `bin/gpm selfupgrade` failing to report failed Grav update [#3116] --- CHANGELOG.md | 1 + system/src/Grav/Console/Gpm/SelfupgradeCommand.php | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f153ce91a..62adc455c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * Fixed fatal error when `site.taxonomies` contains a bad value * Sanitize valid Page extensions from `Page::template_format()` * Fixed `bin/gpm index` erroring out [#3158](https://github.com/getgrav/grav/issues/3158) + * Fixed `bin/gpm selfupgrade` failing to report failed Grav update [#3116](https://github.com/getgrav/grav/issues/3116) # v1.7.0 ## 01/19/2021 diff --git a/system/src/Grav/Console/Gpm/SelfupgradeCommand.php b/system/src/Grav/Console/Gpm/SelfupgradeCommand.php index 2b253ce17..a8000c416 100644 --- a/system/src/Grav/Console/Gpm/SelfupgradeCommand.php +++ b/system/src/Grav/Console/Gpm/SelfupgradeCommand.php @@ -255,13 +255,12 @@ class SelfupgradeCommand extends GpmCommand $this->upgradeGrav($this->file, $folder); - $errorCode = Installer::lastErrorCode(); - if ($this->tmp) { Folder::delete($this->tmp); } - if ($errorCode & (Installer::ZIP_OPEN_ERROR | Installer::ZIP_EXTRACT_ERROR)) { + $errorCode = Installer::lastErrorCode(); + if ($errorCode) { $io->write("\x0D"); // extra white spaces to clear out the buffer properly $io->writeln(' |- Installing upgrade... error ');