Last active
December 31, 2017 17:02
-
-
Save audunolsen/dbc3c22d89b57e74dbd0ea76e16a7301 to your computer and use it in GitHub Desktop.
Shell script to open Xcode projects from the command line, call with $ xcode
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
#################### | |
# Xcode # | |
#################### | |
# Function to open Xcode projects from the command line, call with $ xcode (BASH version) | |
# Bash friendly version | |
function xcode { | |
proj=$( ls -d *.xcodeproj/ 2>/dev/null ) | |
if [ -n "$proj" ]; then | |
# Omit -beta if you're not using beta version | |
open -a Xcode-beta "$proj" | |
else | |
echo "No Xcode project detected." | |
fi | |
} |
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
#################### | |
# Xcode # | |
#################### | |
# Function to open Xcode projects from the command line, call with $ xcode (ZSH version) | |
function xcode { | |
proj=$( ls -d *.xcodeproj/(N) ) | |
if [ $proj != "." ]; then | |
# Omit -beta if you're not using beta version | |
open -a Xcode-beta "$proj" | |
else | |
echo "No Xcode project detected." | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment