Skip to content

Instantly share code, notes, and snippets.

@robyurkowski
Created January 15, 2012 00:04
Show Gist options
  • Save robyurkowski/1613492 to your computer and use it in GitHub Desktop.
Save robyurkowski/1613492 to your computer and use it in GitHub Desktop.
function rr {
cwd=`pwd`
not_found=true
while [[ "`pwd`" != "/" && $not_found == true ]]; do
if [[ ( -f '.rails_root' ) || ( -d 'app' && -d 'config' ) ]]; then
not_found=false
cd `pwd`
continue
fi
cd ..
done
if [[ $not_found == true ]]; then
cd $cwd
echo "Rails root not found."
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment