Skip to content

Instantly share code, notes, and snippets.

@muhqu
Created June 17, 2011 11:22
Show Gist options
  • Save muhqu/1031241 to your computer and use it in GitHub Desktop.
Save muhqu/1031241 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# lets you run xcode from any subdirectory of your project
#
function findproj {
if [ "/" != "$1" ]; then
p=$(basename $1/*.xcodeproj);
if [ "*.xcodeproj" = "$p" ]; then
up=$(dirname $1);
if [ "/" != "$up" ]; then
findproj "$up";
else
exit
fi
else
echo $1/$p;
fi
fi
}
proj=$(findproj $(pwd))
#echo proj: $proj
open -a /Xcode4/Applications/Xcode.app $proj $(pwd)/$1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment