6ca57e035cc7c199ca7c1d893594270ec570f4d3
- Author
- Thi <thii@users.noreply.github.com>
- Committer
- Marc Cornellà <marc.cornella@live.com>
- Date
Message
[plugins/xcode] Fix opening project using a wrong Xcode version (#6829)
Diff
1diff --git a/plugins/xcode/xcode.plugin.zsh b/plugins/xcode/xcode.plugin.zsh
2index b46e05f2feca44ccb95276d8121a4b2ffe0c82db..b80c3e36de3418404437fb9ce2bc40ef617dd2bd 100644
3--- a/plugins/xcode/xcode.plugin.zsh
4+++ b/plugins/xcode/xcode.plugin.zsh
5@@ -22,8 +22,11 @@ function xc {
6 fi
7 return 1
8 else
9- echo "Found ${xcode_proj[1]}"
10- open "${xcode_proj[1]}"
11+ local active_path
12+ active_path=$(xcode-select -p)
13+ active_path=${active_path%%/Contents/Developer*}
14+ echo "Found ${xcode_proj[1]}. Opening with ${active_path}"
15+ open -a "$active_path" "${xcode_proj[1]}"
16 fi
17 }
18