wp-cli/extension-command

"wp plugin update --all --exclude=[]" fails if exclude list has plugin name that isn't installed

embold-given opened this issue · 2 comments

Bug Report

Describe the current, buggy behavior
I was attempting to do a bulk update of some plugins, excluding some. We have a global list of plugins at our company where we generally skip automatic updates and handle them individually. I've run the same command many times without a problem, but this latest time I got an error back.

From my testing, it appears to be from a plugin name that isn't on the site. If I only have plugins in the list that are installed (whether active or not), it works as expected, but because we have a global list, there are sometimes plugins that aren't installed.

Describe how other contributors can replicate this bug
wp plugin update --all --exclude=plugin-name-that-isnt-installed

Describe what you would expect as the correct outcome

I expected it to run updates on plugins and skip any plugins that were in the list, ignoring anything in the list that wasn't actually on the site.

Let us know what environment you are running this on

wp cli info 
OS:     Linux 5.4.0-1080-gke #86-Ubuntu SMP Fri Aug 5 20:26:48 UTC 2022 x86_64
Shell:  /bin/zsh
PHP binary:     /usr/bin/php7.4
PHP version:    7.4.30
php.ini used:   /etc/php/7.4/cli/php.ini
MySQL binary:   /usr/bin/mysql
MySQL version:  mysql  Ver 15.1 Distrib 10.3.34-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
SQL modes:
WP-CLI root dir:        phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:      phar://wp-cli.phar/vendor
WP_CLI phar path:       /home/<client name redacted>
WP-CLI packages dir:
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.6.0

Provide additional context/Screenshots

I ran the command once with only installed plugins and it worked, but adding a plugin that wasn't installed threw an error:
wpcli-update

This is driving me insane as well, it used to work just fine.

This fix was pushed as a patch release with release v2.7.1.