aaemnnosttv / wp-cli-login-command

Log in to WordPress with secure passwordless magic links.
https://aaemnnost.tv/wp-cli-commands/login/
MIT License
294 stars 47 forks source link

Use WP_CLI::runcommand in stead of WP_CLI::run_command #19

Closed stribert closed 6 years ago

stribert commented 7 years ago

Using WP_CLI::runcommand is recomended: https://make.wordpress.org/cli/handbook/internal-api/wp-cli-run-command/

I use fabric (http://www.fabfile.org/) to interact with WP sites. When I ran 'wp login install --activate' I got a failed result with message: 'Success: Companion plugin installed.'. The success message was from installing the plugin, but the error code 1 came from activating the plugin. After making this change installing and activating goes smooth.

aaemnnosttv commented 7 years ago

Hi there, and thanks for the PR!

Interestingly, the test for checking that it can activate the plugin after installed is failing now. I think you just need to have it output the STDOUT from the command, as runcommand seems to capture it.

aaemnnosttv commented 6 years ago

Required a minor change to keep the tests passing, but all good now. Thanks for the contribution @stribert!