Summary:
"wp theme update" deletes theme folder if theme is not in WordPress.org theme directory
Steps to reproduce:
Create empty folder testtheme in wp-content/themes folder
wp theme update testtheme --version=2.0
Environment:
wp-cli 2.0.1
Amazon Linux 2
PHP 7.2.11
WP 5.0
Severity - High (Deletes data & breaks sites for themes not in WordPress.org theme directory)
Expected Results:
No change to theme
Output: ERROR: Theme not found in WordPress.org theme directory and cannot be updated with WP CLI"
Actual Results:
Theme folder and all contents are deleted. Site broken if active theme.
Outputs as follows:
Warning: Couldn't find 'testtheme' in the WordPress.org theme directory.
Error: No themes installed.