diff options
Diffstat (limited to 'plugins/xcode/xcode.plugin.zsh')
-rw-r--r-- | plugins/xcode/xcode.plugin.zsh | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/plugins/xcode/xcode.plugin.zsh b/plugins/xcode/xcode.plugin.zsh index f711c39fb..89703fe3c 100644 --- a/plugins/xcode/xcode.plugin.zsh +++ b/plugins/xcode/xcode.plugin.zsh @@ -4,7 +4,7 @@ alias xcp='xcode-select --print-path' alias xcsel='sudo xcode-select --switch' # original author: @subdigital -# source: http://gist.github.com/subdigital/5420709 +# source: https://gist.github.com/subdigital/5420709 function xc { local xcode_proj if [[ $# == 0 ]]; then @@ -22,11 +22,25 @@ function xc { fi return 1 else - echo "Found ${xcode_proj[1]}" - open "${xcode_proj[1]}" + local active_path + active_path=$(xcode-select -p) + active_path=${active_path%%/Contents/Developer*} + echo "Found ${xcode_proj[1]}. Opening with ${active_path}" + open -a "$active_path" "${xcode_proj[1]}" fi } +# Opens a file or files in the Xcode IDE. Multiple files are opened in multi-file browser +# original author: @possen +function xx { + if [[ $# == 0 ]]; then + echo "Specify file(s) to open in xcode." + return 1 + fi + echo "${xcode_files}" + open -a "Xcode.app" "$@" +} + # "XCode-SELect by Version" - select Xcode by just version number # Uses naming convention: # - different versions of Xcode are named Xcode-<version>.app or stored @@ -70,7 +84,7 @@ function xcselv { function _omz_xcode_print_xcselv_usage { cat << EOF >&2 -Usage: +Usage: xcselv <version> xcselv [options] |