Created
December 7, 2017 03:02
-
-
Save DeveloperBeau/67c4dd817de688838afa5a55bc7e421a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Function to open Xcode projects from the command line, call with 'xcode' | |
| #note - this will not work as expected if you have multiple xcode projects/workspaces in the same folder. | |
| xcode () { | |
| workspace=$(ls -d *.xcworkspace/ 2>/dev/null) | |
| proj=$(ls -d *.xcodeproj/ 2>/dev/null) | |
| if [ -n "$workspace" ]; then | |
| echo "found xcworkspace, opening now..." | |
| open -a Xcode "$workspace" | |
| return | |
| elif [ -n "$proj" ]; then | |
| echo "found xcproject, opening now..." | |
| open -a Xcode "$proj" | |
| return | |
| else | |
| echo "failed to open project - project not found" | |
| return | |
| fi | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment