Opens SSH connections to VVV with initial working directory corresponding to current synced directory on host machine. Wraps commands to Vagrant machine
wp
, phpunit
, grunt
, and npm
. Supersedes the vassh project. Also speeds up SSH connection time by re-using the cached result of vagrant ssh-config
.
Author: Weston Ruter (@westonruter), XWP
License: GPLv2
Important: This currently depends on VVV PR #1311 to be merged or checked out.
Clone repo to system in any directory.
$ git clone https://gist.github.com/ac0f964716d95cdee301880f1865ba30.git vvv-ssh-gist
Include repo on path when starting work on a VVV project in a given Bash session:
$ export PATH=~/vvv-ssh-gist:$PATH
You'll probably want to add a Bash function to your .bashrc
that you invoke whenever you're going to start working with VVV. For example:
function workon_vvv {
export PATH="~/vvv-ssh-gist:$PATH"
}
Change to any directory in a synced folder on your host machine.
$ cd www/wordpress-develop/public_html/src/wp-content/plugins
Start interactive session with initial working directory matching host machine:
$ vvv-ssh
> Last login: Sat Oct 21 20:56:05 2017 from 10.0.2.2
$ pwd
> /srv/www/wordpress-develop/public_html/src/wp-content/plugins
Start interactive TTY session over SSH connection to monitor VM performance.
$ vvv-ssh top
Connect to WP-CLI as if was on your host machine (shortcut for vvv-ssh wp post list).
$ wp post list
Pipe output into WP-CLI on the VM:
$ cat export.sql | wp db import -
Run PHPUnit in the VM.
$ phpunit
Uhm maybe a parser of the
yml
file to get the location can avoid every issue for this problem of paths