From 6ca57e035cc7c199ca7c1d893594270ec570f4d3 Mon Sep 17 00:00:00 2001 From: Thi Date: Fri, 20 Jul 2018 00:20:45 +0900 Subject: [PATCH] [plugins/xcode] Fix opening project using a wrong Xcode version (#6829) --- plugins/xcode/xcode.plugin.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/xcode/xcode.plugin.zsh b/plugins/xcode/xcode.plugin.zsh index b46e05f2f..b80c3e36d 100644 --- a/plugins/xcode/xcode.plugin.zsh +++ b/plugins/xcode/xcode.plugin.zsh @@ -22,8 +22,11 @@ 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 }