I wanted a simple shell command to open a sublime project in the root of my project folder even if I wasn’t in the root, similar to how ant finds the build.xml. This seems to work on the mac, but I haven’t done much shell scripting in a while. Try it if you like. Improve it if you can.
Project file must be named .sublime-project
https://gist.github.com/4700370
#/bin/sh
x=`pwd`;
while "$x" != "/" ] && -z "$y" ] ; do
y=$(find "$x" -maxdepth 1 -name .sublime\-project)
if -n "$y" ];then
echo "$y"
subl --project "$y"
fi
x=`dirname "$x"`;
done