diff options
author | Ash Furrow <ash@ashfurrow.com> | 2016-09-21 11:55:58 -0400 |
---|---|---|
committer | Marc Cornellà <marc.cornella@live.com> | 2016-09-21 17:55:58 +0200 |
commit | 973c92cd91d595fde37a4dbd5a6389072654252f (patch) | |
tree | 88c03f4c8fd13f123563397e0b07c6fc0e654a66 /plugins/xcode/xcode.plugin.zsh | |
parent | f39dcfda8d287bdfeda2bc1e0a7ab3785c6e4a73 (diff) | |
download | zsh-973c92cd91d595fde37a4dbd5a6389072654252f.tar.gz zsh-973c92cd91d595fde37a4dbd5a6389072654252f.tar.bz2 zsh-973c92cd91d595fde37a4dbd5a6389072654252f.zip |
Adds option for directory to Xcode xc function. (#5253)
Diffstat (limited to 'plugins/xcode/xcode.plugin.zsh')
-rw-r--r-- | plugins/xcode/xcode.plugin.zsh | 13 |
1 files changed, 11 insertions, 2 deletions
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]}" |