Created
January 25, 2016 18:46
-
-
Save thefotes/c2c04a5f807201744321 to your computer and use it in GitHub Desktop.
Checks current directory for either .xcworkspace or .xcodeproj, if it finds xcworkspace opens that, otherwise opens xcodeproj
This file contains 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
#!/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 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I thought this would take 5 minutes, it took me an hour because my first implementation based on a pretty poor assumption. In the future I would like to pass the file to open to an apple script of some kind so that it automatically opens maximized.