Skip to content

Instantly share code, notes, and snippets.

@travisseitler
Created February 3, 2022 16:05
Show Gist options
  • Save travisseitler/b062d5c31abaeb77e6f386564394d0cb to your computer and use it in GitHub Desktop.
Save travisseitler/b062d5c31abaeb77e6f386564394d0cb to your computer and use it in GitHub Desktop.
Bash function to run Vagrant commands against VVV machine, regardless of current local directory
################
# VVV Anywhere #
################
# Instructions:
# - Paste the function below into your `.bashrc`/`.bash_profile`/`.zshrc` config.
# - Reload (e.g. "$ source ~/.zshrc") or open a new shell/terminal window.
# Use Vagrant commands on VVV from anywhere (not just inside VVV's directory).
#
# Examples:
# [old] $ cd ~/vvv-local; vagrant ssh
# [new] $ vvvagrant ssh
#
# [old] $ cd ~/vvv-local; vagrant up --provision
# [new] $ vvvagrant up --provision
#
vvvagrant(){
cd ~/vvv-local; # Default location; change this if VVV is installed elsewhere.
vagrant "$@"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment