mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-23 06:12:24 +08:00
Adds option for directory to Xcode xc function. (#5253)
This commit is contained in:
parent
f39dcfda8d
commit
973c92cd91
|
@ -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`
|
||||
|
|
|
@ -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]}"
|
||||
|
|
Loading…
Reference in New Issue
Block a user