xwp / wp-cli-ssh

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

Escape wpcli_command #30

Closed timneutkens closed 8 years ago

timneutkens commented 8 years ago

Just noticed a bug when using the wpcli_command option. The command didn't go through because it looked like this: set -e;wp_command=php7 /usr/local/bin/wp;cd '/var/www/vhosts/isbijna.af/westerveld';$wp_command 'option' 'get' 'siteurl'

which will assign wp_command to php7 and execute /usr/local/bin/wp right after that. This pull request will escape the command so it's formatted:

set -e;wp_command='php7 /usr/local/bin/wp';cd '/var/www/vhosts/isbijna.af/westerveld';$wp_command 'option' 'get' 'siteurl'