Skip to content

Commit 83c81c9

Browse files
committed
better handling of absence of java/javac on PATH in *nix
1 parent 21f4f3c commit 83c81c9

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎koans/run.sh‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
22
mkdir "$DIR"/bin
3+
function exitOnError()
4+
{
5+
rc=$?
6+
if [[ $rc != 0 ]] ; then
7+
exit $rc
8+
fi
9+
}
10+
javac -help
11+
exitOnError
12+
java -version
13+
exitOnError
314
clear
415
java -classpath "$DIR"/bin:"$DIR"/lib/koans.jar com.sandwich.koan.runner.AppLauncher "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"

0 commit comments

Comments
 (0)