projects
/
feisty_meow.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f4c535d
)
falling back if which is not a valid command.
author
Chris Koeritz
<fred@gruntose.com>
Mon, 13 Feb 2012 20:54:54 +0000
(15:54 -0500)
committer
Chris Koeritz
<fred@gruntose.com>
Mon, 13 Feb 2012 20:54:54 +0000
(15:54 -0500)
examples/custom_overrides/fred/java_profile.sh
patch
|
blob
|
history
diff --git
a/examples/custom_overrides/fred/java_profile.sh
b/examples/custom_overrides/fred/java_profile.sh
index 69cb9308e345ea6b061b5213a1433f8bb53d4525..423e99d5149dc2b262a829c25f2b846d40ae8f6f 100644
(file)
--- a/
examples/custom_overrides/fred/java_profile.sh
+++ b/
examples/custom_overrides/fred/java_profile.sh
@@
-6,6
+6,17
@@
############################
############################
+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.
function intuition_failure()
# this reports when we have totally failed to figure out where a folder
# is actually located on the machine.
function intuition_failure()
@@
-63,7
+74,7
@@
if [ ! -d "$JAVA_HOME" ]; then
JAVA_BIN_PIECE=Commands
fi
# last thing is to tell them we couldn't find it.
JAVA_BIN_PIECE=Commands
fi
# last thing is to tell them we couldn't find it.
-if [ ! -d "$JAVA_HOME" -a -z "$(which java 2>/dev/null)" ]; then
+if [ ! -d "$JAVA_HOME" -a -z "$(which
able
java 2>/dev/null)" ]; then
intuition_failure JAVA_HOME
unset JAVA_BIN_PIECE
fi
intuition_failure JAVA_HOME
unset JAVA_BIN_PIECE
fi
@@
-94,7
+105,7
@@
if [ ! -d "$ECLIPSE_DIR" ]; then
ECLIPSE_DIR="/e/tools/eclipse"
fi
# final option is to whine.
ECLIPSE_DIR="/e/tools/eclipse"
fi
# final option is to whine.
-if [ ! -d "$ECLIPSE_DIR" -a -z "$(which eclipse 2>/dev/null)" ]; then
+if [ ! -d "$ECLIPSE_DIR" -a -z "$(which
able
eclipse 2>/dev/null)" ]; then
intuition_failure ECLIPSE_DIR
fi
intuition_failure ECLIPSE_DIR
fi