Created
September 23, 2013 06:45
-
-
Save richo/6667132 to your computer and use it in GitHub Desktop.
_vm with xcode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.expand_path('../lib/manager', __FILE__) | |
class Xcode < Manager | |
include PosixProxy | |
name "xcode" | |
set_prefix "," | |
include Plugin::List | |
# Needs to be included last of the main_case plugins | |
include Plugin::Set | |
include Plugin::Use | |
include Plugin::Reset | |
end | |
_xcode = Xcode.new | |
_xcode.build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
,xcode() { | |
case "$1" in | |
-h|--help) | |
echo "usage: _xcode [version] [opts]" | |
;; | |
-v|--version) | |
echo "_xcode version 0.0.6" | |
;; | |
system) | |
_xcode_reset | |
;; | |
"") | |
for i in ${__xcode_LIST}; do | |
if [ "$i" = "${xcode_ROOT}" ] | |
then | |
star='*' | |
else | |
star=' ' | |
fi | |
echo " $star $(basename $i)" | |
done | |
;; | |
*) | |
for i in ${__xcode_LIST}; do | |
if [ "$(basename $i)" = "$1" ] | |
then | |
shift | |
_xcode_use "$i" "$*" | |
return "$?" | |
fi | |
done | |
echo "_xcode: unknown xcode: $1" | |
;; | |
esac | |
} | |
_xcode_use() { | |
if [ -n "${xcode_ROOT}" ] | |
then | |
_xcode_reset | |
fi | |
export xcode_ROOT="$1" | |
if [ -n "${_xcode_PATH_fragment}" ] | |
then | |
export PATH=$(echo "$PATH" | \sed -e "s|${_xcode_PATH_fragment}||" -e "s|::|:|" -e "s|^:||" -e "s|:$||") | |
fi | |
_xcode_PATH_fragment="${_xcode_PATH_fragment}:${xcode_ROOT}/bin" | |
export PATH="${_xcode_PATH_fragment}:${PATH}" | |
} | |
_xcode_reset() { | |
if [ -n "${_xcode_PATH_fragment}" ] | |
then | |
export PATH=$(echo "$PATH" | \sed -e "s|${_xcode_PATH_fragment}||" -e "s|::|:|" -e "s|^:||" -e "s|:$||") | |
fi | |
_xcode_PATH_fragment='' | |
if [ -n "${xcode_ROOT}" ] | |
then | |
unset xcode_ROOT | |
fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
elektra ⚡ ,xcode ~ | |
xcode4 | |
xcode5 | |
elektra ⚡ which lldb ~ | |
/usr/bin/lldb | |
elektra ⚡ ,xcode xcode4 ~ | |
elektra ⚡ which lldb ~ | |
elekt 1 ⚡ which lldb ~ | |
/Users/richo/.xcode/xcode4/bin/lldb | |
elektra ⚡ ,xcode xcode5 ~ | |
elektra ⚡ which lldb ~ | |
/Users/richo/.xcode/xcode5/bin/lldb | |
elektra ⚡ ,xcode system ~ | |
elektra ⚡ which lldb ~ | |
/usr/bin/lldb | |
elektra ⚡ ~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Shell config is like:
With symlinks like: