diff --git a/CHANGELOG.md b/CHANGELOG.md index 5736cb010..88f99e65d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,12 @@ 1. [](#improved) * Added support for symlinking individual plugins and themes by using `bin/grav install -p myplugin` or `-t mytheme` * Added support for symlinking plugins and themes with `hebe.json` file to support custom folder structures + * Added support for running post-install scripts in `bin/gpm selfupgrade` if Grav was updated manually 1. [](#bugfix) * Fixed default GPM Channel back to 'stable' - this was inadvertently left as 'testing' [#3163](https://github.com/getgrav/grav/issues/3163) * Fixed broken stream initialization if `environment://` paths aren't streams * Fixed Clockwork debugger in sub-folder multi-site setups - * Fixed `Unsupported option "curl" passed to "Symfony\Component\HttpClient\CurlHttpClient"` in `bin/gpm selfupdate` [#3165](https://github.com/getgrav/grav/issues/3165) + * Fixed `Unsupported option "curl" passed to "Symfony\Component\HttpClient\CurlHttpClient"` in `bin/gpm selfupgrade` [#3165](https://github.com/getgrav/grav/issues/3165) # v1.7.1 ## 01/20/2021 diff --git a/system/src/Grav/Console/Gpm/SelfupgradeCommand.php b/system/src/Grav/Console/Gpm/SelfupgradeCommand.php index 3f1cfa2ec..4acb74ac9 100644 --- a/system/src/Grav/Console/Gpm/SelfupgradeCommand.php +++ b/system/src/Grav/Console/Gpm/SelfupgradeCommand.php @@ -16,6 +16,7 @@ use Grav\Common\GPM\Response; use Grav\Common\GPM\Upgrader; use Grav\Common\Grav; use Grav\Console\GpmCommand; +use Grav\Installer\Install; use RuntimeException; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Input\InputOption; @@ -126,7 +127,32 @@ class SelfupgradeCommand extends GpmCommand } if (!$this->overwrite && !$this->upgrader->isUpgradable()) { - $io->writeln("You are already running the latest version of Grav (v{$local}) released on {$release}"); + $io->writeln("You are already running the latest version of Grav v{$local}"); + $io->writeln("which was released on {$release}"); + + $config = Grav::instance()['config']; + if ($config->get('versions.core.grav.schema') !== GRAV_SCHEMA) { + $io->newLine(); + $io->writeln('However not all post-install scripts have not been run.'); + if (!$this->all_yes) { + $question = new ConfirmationQuestion( + 'Would you like to run the scripts? [Y|n] ', + true + ); + $answer = $io->askQuestion($question); + } else { + $answer = true; + } + + if ($answer) { + // Finalize installation. + Install::instance()->finalize(); + + $io->write(' |- Running post-install scripts... '); + $io->writeln(" '- Success! "); + $io->newLine(); + } + } return 0; }