Skip to content

Instantly share code, notes, and snippets.

@leeahoward
Created February 3, 2013 02:58
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 leeahoward/4700370 to your computer and use it in GitHub Desktop.
Save leeahoward/4700370 to your computer and use it in GitHub Desktop.
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.
#/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment