Skip to content

Instantly share code, notes, and snippets.

@manuelpichler
Created May 31, 2016 07:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manuelpichler/4a6703f739f218a96f2fb32d03cd3d3e to your computer and use it in GitHub Desktop.
Save manuelpichler/4a6703f739f218a96f2fb32d03cd3d3e to your computer and use it in GitHub Desktop.
#!/bin/sh
DIR="`pwd`"
while [ ! -e "${DIR}/vagrant/Vagrantfile" ] && [ "" != "${DIR}" ] && [ "/" != "${DIR}" ]
do
#echo "${DIR}"
DIR=`dirname "${DIR}"`
done
if [ -e "${DIR}/vagrant/Vagrantfile" ]
then
cd "${DIR}/vagrant/"
vagrant $@
else
DIR="`pwd`"
while [ ! -e "${DIR}/Vagrant/Vagrantfile" ] && [ "" != "${DIR}" ] && [ "/" != "${DIR}" ]
do
#echo "${DIR}"
DIR=`dirname "${DIR}"`
done
if [ -e "${DIR}/Vagrant/Vagrantfile" ]
then
cd "${DIR}/Vagrant/"
vagrant $@
else
DIR="`pwd`"
while [ ! -e "${DIR}/Vagrantfile" ] && [ "" != "${DIR}" ] && [ "/" != "${DIR}" ]
do
#echo "${DIR}"
DIR=`dirname "${DIR}"`
done
if [ -e "${DIR}/Vagrantfile" ]
then
cd "${DIR}/"
vagrant $@
else
echo "No vagrant directory found"
exit 142
fi
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment