mirror of
https://github.com/getgrav/grav.git
synced 2025-10-26 07:56:07 +01:00
force upgrades before updating
Signed-off-by: Andy Miller <rhuk@mac.com>
This commit is contained in:
@@ -313,14 +313,10 @@ class SelfupgradeCommand extends GpmCommand
|
||||
$io->writeln(sprintf(' - %s (%s) %s → %s', $slug, $type, $current, $available));
|
||||
}
|
||||
|
||||
if (!$this->all_yes) {
|
||||
$question = new ConfirmationQuestion('Continue without updating these packages? [y|N] ', false);
|
||||
if (!$io->askQuestion($question)) {
|
||||
$io->writeln('Aborting self-upgrade. Run `bin/gpm update` first.');
|
||||
$io->writeln(' › Please run `bin/gpm update` to bring these packages current before upgrading Grav.');
|
||||
$io->writeln('Aborting self-upgrade. Run `bin/gpm update` first.');
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($conflicts) {
|
||||
|
||||
@@ -23,7 +23,7 @@ class SelfupgradeCommandTest extends \Codeception\TestCase\Test
|
||||
self::assertSame([], $style->messages);
|
||||
}
|
||||
|
||||
public function testHandlePreflightReportSkipsPromptsWhenAllYes(): void
|
||||
public function testHandlePreflightReportFailsWhenPendingEvenWithAllYes(): void
|
||||
{
|
||||
$command = new TestSelfupgradeCommand();
|
||||
[$style] = $this->injectIo($command);
|
||||
@@ -35,10 +35,9 @@ class SelfupgradeCommandTest extends \Codeception\TestCase\Test
|
||||
'warnings' => ['pending']
|
||||
]);
|
||||
|
||||
self::assertTrue($result);
|
||||
self::assertFalse($result);
|
||||
$output = implode("\n", $style->messages);
|
||||
self::assertStringContainsString('pending', $output);
|
||||
self::assertStringContainsString('psr/log', $output);
|
||||
self::assertStringContainsString('Run `bin/gpm update` first', $output);
|
||||
}
|
||||
|
||||
public function testHandlePreflightReportAbortsOnPendingWhenDeclined(): void
|
||||
|
||||
Reference in New Issue
Block a user