Browse Source

[plugins/xcode] Fix opening project using a wrong Xcode version (#6829)

Thi 5 years ago
parent
commit
6ca57e035c
1 changed files with 5 additions and 2 deletions
  1. 5 2
      plugins/xcode/xcode.plugin.zsh

+ 5 - 2
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
 }