Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle extension activation for WP error or extension not found #146

Merged
merged 5 commits into from Mar 30, 2019

Conversation

@abhijitrakas
Copy link
Contributor

@abhijitrakas abhijitrakas commented Feb 25, 2019

closes #127

Copy link
Member

@schlessera schlessera left a comment

Thanks for the PR, @abhijitrakas!

Can you think of a way to write a test for this change so that we can verify its behavior and guard against regressions?

@@ -210,7 +210,10 @@ public function install( $args, $assoc_args ) {
}
}

if ( $result ) {
// Check plugin is available or not.
$plugin = $this->fetcher->get_many( array( $slug ) );

This comment has been minimized.

@schlessera

schlessera Mar 21, 2019
Member

This could just as well be a theme here, so better use the term extension instead:

Suggested change
$plugin = $this->fetcher->get_many( array( $slug ) );
$extension = $this->fetcher->get_many( array( $slug ) );
// Check plugin is available or not.
$plugin = $this->fetcher->get_many( array( $slug ) );

if ( ! is_wp_error( $result ) && count( $plugin ) > 0 ) {

This comment has been minimized.

@schlessera

schlessera Mar 21, 2019
Member

Suggested change
if ( ! is_wp_error( $result ) && count( $plugin ) > 0 ) {
if ( ! is_wp_error( $result ) && count( $extension ) > 0 ) {
@abhijitrakas abhijitrakas requested a review from wp-cli/committers as a code owner Mar 30, 2019
@abhijitrakas
Copy link
Contributor Author

@abhijitrakas abhijitrakas commented Mar 30, 2019

@schlessera PR Updated. Thanks.

@schlessera
Copy link
Member

@schlessera schlessera commented Mar 30, 2019

Thanks for the PR, @abhijitrakas !

@schlessera schlessera merged commit 5a0d2ce into wp-cli:master Mar 30, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.