Last Updated: February 25, 2016
·
495
· elseym

transparent vagrant subdirectory

in many projects, you might have your vagrant stuff contained within a subdirectory.
but lazy people like me tend to not want to cd vagrant and vagrant up and cd .. back, so with this little alias you can stay right in you project's root and use vagrant as if it was not scoped.

alias vagrant='VAGRANT_CWD=$(ls -d vagrant 2>/dev/null || echo ''.'') vagrant'

just insert this line into your .bashrc, .profile, or .zshrc and your'e good to go!

(p.s. change the first occurrence of 'vagrant' to whatever your subdirectory is called.)