force upgrades before updating

Signed-off-by: Andy Miller <rhuk@mac.com>
This commit is contained in:
Andy Miller
2025-10-15 11:00:54 -06:00
parent 2b1a7d3fb6
commit b55e86a8ba
2 changed files with 6 additions and 11 deletions

View File

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

View File

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