Merge pull request #275 from jacobono/gvm-update-and-cask-plugin

This commit is contained in:
Bruno Pinto 2014-12-30 16:38:39 -02:00
commit a4e58aafb7
2 changed files with 28 additions and 0 deletions

1
plugins/cask/cask.load Normal file
View File

@ -0,0 +1 @@
_prepend_path $HOME/.cask/bin

View File

@ -1,3 +1,30 @@
for gvm_path in (find $HOME/.gvm/*/current/bin -maxdepth 0)
_prepend_path $gvm_path
set -l module_info (echo $gvm_path | perl -ne 'm|(.*/.gvm/(\w+)/current)/bin| && print "$1 $2"')
set -l module_dir (echo $module_info | awk -F' ' '{print $1}')
set -l module_name (echo $module_info | awk -F' ' '{print $2}')
set -l module_home (echo $module_name | tr '[:lower:]' '[:upper:]')_HOME
set -gx "$module_home" $module_dir
end
# ONLY checked on OSX! Please add for other OS's...
if test -z $JAVA_HOME
if test -f "/usr/libexec/java_home"
set -gx JAVA_HOME (/usr/libexec/java_home)
end
if test -z $JAVA_HOME
set -l java_homes "/Library/Java/Home" "/System/Library/Frameworks/JavaVM.framework/Home"
for file in $java_homes
if test -d $file
set -gx JAVA_HOME $file
break
end
end
end
end
if test -z $JAVA_HOME
echo "GVM: JAVA_HOME not set please set JAVA_HOME."
end