[zsh] Move open-xcode function to its own file and autoload it in zshrc
This commit is contained in:
parent
3a3b73a915
commit
aa81cb66eb
3 changed files with 13 additions and 8 deletions
|
@ -37,14 +37,6 @@ 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-xcode'
|
||||
alias -s xcworkspace='open-xcode'
|
||||
|
|
12
zsh/func/open-xcode
Normal file
12
zsh/func/open-xcode
Normal file
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env zsh
|
||||
# Eryn Wells <eryn@erynwells.me>
|
||||
|
||||
open-xcode() {
|
||||
local selectedXcode=`xcode-select -p`
|
||||
while [[ ! `basename $selectedXcode` =~ ".app$" ]]; do
|
||||
selectedXcode=`dirname "$selectedXcode"`
|
||||
done
|
||||
open -a "$selectedXcode" $@
|
||||
}
|
||||
|
||||
open-xcode "$@"
|
Loading…
Add table
Add a link
Reference in a new issue