diff options
author | Robby Russell <robby@planetargon.com> | 2016-09-24 16:36:50 -0700 |
---|---|---|
committer | Robby Russell <robby@planetargon.com> | 2016-09-24 16:36:50 -0700 |
commit | a21d57a17070ca21561fdb64deb29821c4cc6f30 (patch) | |
tree | aeeb7124be4b233b21249ba018bb1c79d3cccfe0 /plugins/xcode | |
parent | fdc59e5499c5aabfd287c73df66a4fb7472732e8 (diff) | |
parent | 1b7fc2f3aca32ba8713be0e27305c5cf578033f6 (diff) | |
download | zsh-a21d57a17070ca21561fdb64deb29821c4cc6f30.tar.gz zsh-a21d57a17070ca21561fdb64deb29821c4cc6f30.tar.bz2 zsh-a21d57a17070ca21561fdb64deb29821c4cc6f30.zip |
Merge branch 'master' of github.com:robbyrussell/oh-my-zsh
Diffstat (limited to 'plugins/xcode')
-rw-r--r-- | plugins/xcode/README.md | 2 | ||||
-rw-r--r-- | plugins/xcode/xcode.plugin.zsh | 13 |
2 files changed, 12 insertions, 3 deletions
diff --git a/plugins/xcode/README.md b/plugins/xcode/README.md index 15e657859..c12ce047f 100644 --- a/plugins/xcode/README.md +++ b/plugins/xcode/README.md @@ -26,7 +26,7 @@ plugins=(... xcode) ### `xc` -Opens the current directory in Xcode as an Xcode project. This will open one of the `.xcworkspace` and `.xcodeproj` files that it can find in the current working directory. +Opens the current directory in Xcode as an Xcode project. This will open one of the `.xcworkspace` and `.xcodeproj` files that it can find in the current working directory. You can also specify a directory to look in for the Xcode files. Returns 1 if it didn't find any relevant files. ### `simulator` diff --git a/plugins/xcode/xcode.plugin.zsh b/plugins/xcode/xcode.plugin.zsh index 0a2fa0839..f711c39fb 100644 --- a/plugins/xcode/xcode.plugin.zsh +++ b/plugins/xcode/xcode.plugin.zsh @@ -7,10 +7,19 @@ alias xcsel='sudo xcode-select --switch' # source: http://gist.github.com/subdigital/5420709 function xc { local xcode_proj - xcode_proj=(*.{xcworkspace,xcodeproj}(N)) + if [[ $# == 0 ]]; then + xcode_proj=(*.{xcworkspace,xcodeproj}(N)) + else + xcode_proj=($1/*.{xcworkspace,xcodeproj}(N)) + fi + if [[ ${#xcode_proj} -eq 0 ]]; then - echo "No xcworkspace/xcodeproj file found in the current directory." + if [[ $# == 0 ]]; then + echo "No xcworkspace/xcodeproj file found in the current directory." + else + echo "No xcworkspace/xcodeproj file found in $1." + fi return 1 else echo "Found ${xcode_proj[1]}" |