Skip to content

Instantly share code, notes, and snippets.

@lukemorton
Created March 16, 2015 11:28
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukemorton/bc1951042f5c71346269 to your computer and use it in GitHub Desktop.
Save lukemorton/bc1951042f5c71346269 to your computer and use it in GitHub Desktop.
#!/bin/bash
vrake=`readlink $0`
expected_dir="${vrake%/*}/www/"
expected_dir_length=${#expected_dir}
dirname=${PWD##*/}
if [[ "${PWD:0:$expected_dir_length}" != "$expected_dir" ]]; then
echo "You need to be inside a directory in $expected_dir"
echo "You are in $PWD"
exit 1
fi
vagrant ssh -c "cd /var/www/$dirname && $*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment