From 0bac44ceda40dad0945645be2c9679c5fadd3a54 Mon Sep 17 00:00:00 2001 From: Daniel Mijares Date: Sat, 6 Dec 2014 22:19:09 -0500 Subject: [PATCH 1/4] cask plugin to add cask to $PATH --- plugins/cask/cask.load | 1 + 1 file changed, 1 insertion(+) create mode 100644 plugins/cask/cask.load diff --git a/plugins/cask/cask.load b/plugins/cask/cask.load new file mode 100644 index 0000000..3701854 --- /dev/null +++ b/plugins/cask/cask.load @@ -0,0 +1 @@ +_prepend_path $HOME/.cask/bin \ No newline at end of file From e0ae3a7db44f1a8acd162ae435dcf93a3438d34a Mon Sep 17 00:00:00 2001 From: Daniel Mijares Date: Sat, 6 Dec 2014 22:27:14 -0500 Subject: [PATCH 2/4] plugin was lacking setting {}_HOME variables for all gvm installed binaries, this fixes that. This also sets JAVA_HOME (only tested on OSX). --- plugins/gvm/gvm.load | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/plugins/gvm/gvm.load b/plugins/gvm/gvm.load index db881e7..f17cc2d 100644 --- a/plugins/gvm/gvm.load +++ b/plugins/gvm/gvm.load @@ -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 -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 + From efa2746e4516c8bede2d35329436767aa7ac25fd Mon Sep 17 00:00:00 2001 From: Daniel Mijares Date: Tue, 9 Dec 2014 21:31:49 -0500 Subject: [PATCH 3/4] silly mistake, forgot this is a soft link and needed to follow the link --- plugins/gvm/gvm.load | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/gvm/gvm.load b/plugins/gvm/gvm.load index f17cc2d..a67f729 100644 --- a/plugins/gvm/gvm.load +++ b/plugins/gvm/gvm.load @@ -10,7 +10,7 @@ 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" + 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 From 228b9c5e3414d5c8f357bc0a1ba05f59a5dddb21 Mon Sep 17 00:00:00 2001 From: Daniel Mijares Date: Fri, 26 Dec 2014 11:47:59 -0700 Subject: [PATCH 4/4] removing `-e` tests when cheking for `-f` or `-d` adding local variable flag and setting the variable if java home isn't taken care of in the first if check. For some reason there were different tab widths for this bottom section, unifying to what the top was at -- 2 spaces. --- plugins/gvm/gvm.load | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/plugins/gvm/gvm.load b/plugins/gvm/gvm.load index a67f729..198d02c 100644 --- a/plugins/gvm/gvm.load +++ b/plugins/gvm/gvm.load @@ -9,22 +9,22 @@ 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 + 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 end if test -z $JAVA_HOME - echo "GVM: JAVA_HOME not set please set JAVA_HOME." + echo "GVM: JAVA_HOME not set please set JAVA_HOME." end