From: Chris Koeritz Date: Fri, 30 Aug 2013 05:40:34 +0000 (-0400) Subject: shifted whichable function into the core, since it's useful. X-Git-Tag: 2.140.90~938 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=7381dff08b01e224a5c8c9e99b7d3bc317efdb98;p=feisty_meow.git shifted whichable function into the core, since it's useful. need to seek out any users of bare which. --- 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()