Skip to content

Commit d1e3e1c

Browse files
Jacob TomawJacob Tomaw
authored andcommitted
Made run quieter and built classpath to include all jars in lib
1 parent 0cee177 commit d1e3e1c

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ bin/*
44
*/bin/*
55
koans/data
66
koans/data*
7+
.classpath
8+
.project

‎koans/run.sh‎

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
2-
mkdir "$DIR"/app
3-
mkdir "$DIR"/app/bin
2+
mkdir -p "$DIR"/app
3+
mkdir -p "$DIR"/app/bin
44
function exitOnError()
55
{
66
rc=$?
77
if [[ $rc != 0 ]] ; then
88
exit $rc
99
fi
1010
}
11-
javac -help
11+
12+
function buildClasspath()
13+
{
14+
appDir=$1
15+
classpath=$appDir/bin
16+
17+
for jar in $appDir/lib/*; do
18+
classpath=$classpath:$jar
19+
done
20+
}
21+
javac -help > /dev/null 2>&1
1222
exitOnError
13-
java -version
23+
java -version > /dev/null 2>&1
1424
exitOnError
15-
clear
16-
java -classpath "$DIR"/app/bin:"$DIR"/app/lib/koans.jar com.sandwich.koan.runner.AppLauncher "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"
25+
buildClasspath "$DIR"/app
26+
java -classpath $classpath com.sandwich.koan.runner.AppLauncher "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"

0 commit comments

Comments
 (0)