From 7381dff08b01e224a5c8c9e99b7d3bc317efdb98 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Fri, 30 Aug 2013 01:40:34 -0400 Subject: [PATCH] shifted whichable function into the core, since it's useful. need to seek out any users of bare which. --- customizing/fred/java_profile.sh | 22 ++++++++++++---------- scripts/core/functions.sh | 14 ++++++++++++++ 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/customizing/fred/java_profile.sh b/customizing/fred/java_profile.sh index 7e0c1721..f9268a01 100644 --- a/customizing/fred/java_profile.sh +++ b/customizing/fred/java_profile.sh @@ -6,16 +6,18 @@ ############################ -function whichable() -{ - to_find="$1"; shift - which which &>/dev/null - if [ $? -ne 0 ]; then - # there is no which command here. we produce nothing due to this. - echo - fi - echo $(which $to_find) -} +source $FEISTY_MEOW_SCRIPTS/core/functions.sh + +#function whichable() +#{ +# to_find="$1"; shift +# which which &>/dev/null +# if [ $? -ne 0 ]; then +# # there is no which command here. we produce nothing due to this. +# echo +# fi +# echo $(which $to_find) +#} # this reports when we have totally failed to figure out where a folder # is actually located on the machine. diff --git a/scripts/core/functions.sh b/scripts/core/functions.sh index 924266dc..88f3d315 100644 --- a/scripts/core/functions.sh +++ b/scripts/core/functions.sh @@ -275,6 +275,20 @@ if [ -z "$skip_all" ]; then echo } + # a wrapper for the which command that finds items on the path. some OSes + # do not provide which, so we want to not be spewing errors when that + # happens. + function whichable() + { + to_find="$1"; shift + which which &>/dev/null + if [ $? -ne 0 ]; then + # there is no which command here. we produce nothing due to this. + echo + fi + echo $(which $to_find) + } + # copies a set of custom scripts into the proper location for feisty meow # to merge their functions and aliases with the standard set. function recustomize() -- 2.34.1