Skip to content

Instantly share code, notes, and snippets.

@dev4dev
Created November 10, 2014 18:45
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 dev4dev/978e6e21db95f86da4f8 to your computer and use it in GitHub Desktop.
Save dev4dev/978e6e21db95f86da4f8 to your computer and use it in GitHub Desktop.
Function for opening Xcode workspace/project
xc() {
WORKSPACE=$(ls -dt *.xcworkspace 2>/dev/null | head -n 1)
PROJECT=$(ls -dt *.xcodeproj 2>/dev/null | head -n 1)
if [[ $WORKSPACE != '' ]]; then
open $WORKSPACE
elif [[ $PROJECT != '' ]]; then
open $PROJECT
else
echo 'R U SROUS?'
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment