-
Notifications
You must be signed in to change notification settings - Fork 0
/
runner.sh
executable file
·38 lines (30 loc) · 1.06 KB
/
runner.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
BASEDIR=`dirname $0`
INITIAL_DECK_FILE_PATH=${BASEDIR}"/deck/deck"
RED_BOX_FILE_PATH=${BASEDIR}"/box/red"
ORANGE_BOX_FILE_PATH=${BASEDIR}"/box/orange"
GREEN_BOX_FILE_PATH=${BASEDIR}"/box/green"
INITIAL_DECK_SYSTEM_PROPERTY="-Dinitial.deck.file.path="${INITIAL_DECK_FILE_PATH}
RED_BOX_SYSTEM_PROPERTY="-Dred.box.file.path="${RED_BOX_FILE_PATH}
ORANGE_BOX_SYSTEM_PROPERTY="-Dorange.box.file.path="${ORANGE_BOX_FILE_PATH}
GREEN_BOX_SYSTEM_PROPERTY="-Dgreen.box.file.path="${GREEN_BOX_FILE_PATH}
JAVA_OPTS="${INITIAL_DECK_SYSTEM_PROPERTY} ${RED_BOX_SYSTEM_PROPERTY} ${ORANGE_BOX_SYSTEM_PROPERTY} ${GREEN_BOX_SYSTEM_PROPERTY}"
cleanBoxes() {
> box/red
> box/orange
> box/green
}
while true; do
clear
java ${JAVA_OPTS} -jar bin/anki-dfanaro-jar-with-dependencies.jar
echo
echo
echo "Select an option:"
select op in "Start new session" "Reset game" "Exit"; do
case ${op} in
"Start new session" ) break;;
"Reset game" ) cleanBoxes; break;;
"Exit" ) exit;;
esac
done
done