Added support for running post-install scripts in bin/gpm selfupgrade if Grav was updated manually

This commit is contained in:
Matias Griese
2021-01-21 16:18:58 +02:00
parent 849097921a
commit 531ce433fe
2 changed files with 29 additions and 2 deletions

View File

@@ -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

View File

@@ -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 <green>Grav v{$local}</green>");
$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(" '- <green>Success!</green> ");
$io->newLine();
}
}
return 0;
}