xwp / wp-cli-ssh

[OBSOLETE] Seamlessly run WP-CLI commands on a remote server via SSH
157 stars 14 forks source link

Silently ignore --host and missing ssh config #7

Closed westonruter closed 10 years ago

westonruter commented 10 years ago

If I have my bash alias set up:

alias wp='wp ssh --host=vagrant'

And I try to use WP-CLI on a WordPress install which is not configured for SSH, then I get an error:

Error: The target SSH host you specified doesn't exist in the wp-cli config file.

If the SSH config is not present, then shoukd WP-CLI SSH should just silently ignore it was ever passed? Or is it just bad to have wp alias to wp ssh? Should instead the alias be wpvag, for example?

jonathanbardo commented 10 years ago

@westonruter I think we have 2 solutions for this kind of scenario. One is to have a different alias, which might not be desirable (didn't we do this so it's mostly transparent to the user). Or do another exec (we are too late in the process to send the other command back to local wp-cli) with the basic wp-cli command and removing the ssh argument altogether.

jonathanbardo commented 10 years ago

Please see PR, you can now have an alias and it will fallback if no config is provided in the yml file.