Skip to content

Spin up new Phar after auto update #6193

@swissspidy

Description

@swissspidy

It always bugs me that I have to re-run my previous WP-CLI command when it detected & installed an auto-update.

That's because of this line in Runner::auto_check_update():

wp-cli/php/WP_CLI/Runner.php

Lines 2033 to 2036 in 28c97a9

// Looks like an update is available, so let's prompt to update.
WP_CLI::run_command( [ 'cli', 'update' ] );
// If the Phar was replaced, we can't proceed with the original process.
exit;

I'm wondering: can't we just spin up the new Phar with the originally passed arguments in a subprocess?

This way, the user would get the benefit of the new features without the hassle of having to manually re-run the previous command.

Alternatively or additonally: pass --yes to cli update by default to disable the confirmation prompt (of course this should be configurable with an env var).

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions