[zsh] Open xcodeproj and xcworkspace files by looking for the currently selected Xcode
This commit is contained in:
parent
03a6f10522
commit
de14a7c00d
1 changed files with 10 additions and 1 deletions
|
@ -37,5 +37,14 @@ function finder {
|
|||
open -R "$1"
|
||||
}
|
||||
|
||||
function open-xcode {
|
||||
local selectedXcode=`xcode-select -p`
|
||||
while [[ ! `basename $selectedXcode` =~ ".app$" ]]; do
|
||||
selectedXcode=`dirname "$selectedXcode"`
|
||||
done
|
||||
open -a "$selectedXcode" $@
|
||||
}
|
||||
|
||||
alias -s app='open'
|
||||
alias -s xcodeproj='open -a Xcode'
|
||||
alias -s xcodeproj='open-xcode'
|
||||
alias -s xcworkspace='open-xcode'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue