mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2024-11-30 04:23:36 +08:00
plugin was lacking setting {}_HOME variables for all gvm installed
binaries, this fixes that. This also sets JAVA_HOME (only tested on OSX).
This commit is contained in:
parent
0bac44ceda
commit
e0ae3a7db4
|
@ -1,3 +1,30 @@
|
||||||
for gvm_path in (find $HOME/.gvm/*/current/bin -maxdepth 0)
|
for gvm_path in (find $HOME/.gvm/*/current/bin -maxdepth 0)
|
||||||
_prepend_path $gvm_path
|
_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
|
end
|
||||||
|
|
||||||
|
# ONLY checked on OSX! Please add for other OS's...
|
||||||
|
if test -z $JAVA_HOME
|
||||||
|
if test -e "/usr/libexec/java_home" -a -f "/usr/libexec/java_home"
|
||||||
|
set -gx JAVA_HOME "/usr/libexec/java_home"
|
||||||
|
end
|
||||||
|
set java_homes "/Library/Java/Home" "/System/Library/Frameworks/JavaVM.framework/Home"
|
||||||
|
if test -z $JAVA_HOME
|
||||||
|
for file in $java_homes
|
||||||
|
echo $file
|
||||||
|
if test -e $file -a -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user