Skip to content

Instantly share code, notes, and snippets.

@thefotes
Created February 23, 2020 19:28
Show Gist options
  • Save thefotes/0021479be7e55d713a50198a188b252f to your computer and use it in GitHub Desktop.
Save thefotes/0021479be7e55d713a50198a188b252f to your computer and use it in GitHub Desktop.
Opens either xcodeproj or xcworkspace in CWD
#!/bin/bash
set -e
xcodeproj=`find . -maxdepth 1 -name "*.xcodeproj"`
proj_name=`echo $xcodeproj | sed 's/.\///g' | sed 's/.xcodeproj//g'`
xcworkspace=`find . -maxdepth 1 -name "$proj_name.xcworkspace"`
if [[ ! -z $xcworkspace && -e $xcworkspace ]]; then
open $xcworkspace
else
open $xcodeproj
fi
@apexskier
Copy link

Thanks for the info, xed has been pretty fast for me. My big issue is that if it can't find something to open it gets slow, pops an alert within Xcode, and the exits cleanly (instead of exiting with an error code). I ended up rolling my own script as well.

@thefotes
Copy link
Author

thefotes commented Apr 4, 2020

Thanks for the info, xed has been pretty fast for me. My big issue is that if it can't find something to open it gets slow, pops an alert within Xcode, and the exits cleanly (instead of exiting with an error code). I ended up rolling my own script as well.

Right on 🤙

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