case 'newer_installed':
case 'update_available':
if ( isset( $assoc_args['version'] )
- && version_compare( $status['version'], $assoc_args['version'], '>=' ) ) {
+ && version_compare( $status['version'], $assoc_args['version'], '!=' ) ) {
+
+ WP_CLI::confirm( "A different version is installed. Overwrite it?", $assoc_args );
+
list( $file, $name ) = $this->parse_name( array( $api->slug ) );
$this->_delete( $file );
}
/**
* Install a plugin.
*
- * @synopsis <plugin|zip> [--version=<version>] [--activate]
+ * @synopsis <plugin|zip> [--version=<version>] [--activate] [--yes]
*/
function install( $args, $assoc_args ) {
parent::install( $args, $assoc_args );
} else if ( $theme_obj->exists()
&& version_compare( $assoc_args['version'], $theme_obj->version, '!=' ) ) {
// Theme is installed, but we want a different version
+ WP_CLI::confirm( "A different version is installed. Overwrite it?", $assoc_args );
+
WP_CLI::log( sprintf( 'Installing %s (%s)', $api->name, $api->version ) );
delete_theme( $theme_obj->stylesheet );
$result = WP_CLI\Utils\get_upgrader( $this->upgrader )->install( $api->download_link );
/**
* Install a theme.
*
- * @synopsis <theme|zip> [--version=<version>] [--activate]
+ * @synopsis <theme|zip> [--version=<version>] [--activate] [--yes]
*/
function install( $args, $assoc_args ) {
parent::install( $args, $assoc_args );