Skip to content

Instantly share code, notes, and snippets.

@joehoyle
Created February 10, 2014 23:21
Show Gist options
  • Save joehoyle/8926266 to your computer and use it in GitHub Desktop.
Save joehoyle/8926266 to your computer and use it in GitHub Desktop.
.zshrc
# Run wp-cli from the host machine
wp() {
DIR=`basename $PWD`
ARGS=$*
vagrant ssh -c "cd /srv/www/${DIR} ; wp ${ARGS}"
}
# SSH into vagrant directly to your current directory on the hostmachine
vssh() {
DIRS=`echo $PWD | sed -e 's,.*projects,/srv/www,'`
ARGS=$*
ssh [email protected] -t "cd ${DIRS} ; zsh -l"
}
# Run any command in Vagrant from the host machine, will use the same dir as you are in
v() {
ARGS=$*
DIRS=`echo $PWD | sed -e 's,.*projects,/srv/www,'`
vagrant ssh -c "cd ${DIRS} ; ${ARGS}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment