Skip to content

Instantly share code, notes, and snippets.

@jiming
Forked from mmorey/xc
Created February 13, 2014 03:33
Show Gist options
  • Save jiming/8969304 to your computer and use it in GitHub Desktop.
Save jiming/8969304 to your computer and use it in GitHub Desktop.
xc(){
xcode_proj=`find . -name "*.xc*" -d 1 | sort -r | head -1`
if [ `echo -n $xcode_proj | wc -m` == 0 ]
then
echo "No xcworkspace/xcodeproj file found in the current directory."
else
echo "Found $xcode_proj"
open "$xcode_proj"
fi
}
@jiming
Copy link
Author

jiming commented Feb 13, 2014

If your using Zsh, try the following

function xc {
xcode_proj=find . -name "*.xc*" -d 1 | sort -r | head -1

if [[ `echo -n $xcode_proj | wc -m` == 0 ]]
then
    echo "No xcworkspace/xcodeproj file found in the current directory."
else
    echo "Found $xcode_proj"
    open "$xcode_proj"
fi

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment