public
Created

A shell script to open the first .sublime-project file found searching from your current folder to the root. Similar to how ant searches for a build.xml file.

  • Download Gist
sb.sh
Shell
1 2 3 4 5 6 7 8 9 10
#/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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.