This commit is contained in:
John Regner 2018-04-17 20:58:04 +00:00 committed by GitHub
commit 429357d824
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -23,7 +23,14 @@ function xc {
return 1
else
echo "Found ${xcode_proj[1]}"
open "${xcode_proj[1]}"
active_path=$(xcode-select -p)
if [[ ${active_path} =~ "Xcode" ]]; then
active_path=${active_path%%/Contents/Developer*}
echo "Opening with ${active_path}"
open -a "${active_path}" "${xcode_proj[1]}"
else # No Xcode installed
open "${xcode_proj[1]}" # Fall back to using Finder suggested application
fi
fi
}