-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runlog.sh
65 lines (60 loc) · 897 Bytes
/
runlog.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
check_pip() {
pip install -r requirements.txt > /dev/null
if [ $? = 0 ]; then
start
fi
printf "Checking pip error"
exit 1
}
start() {
"${python_cmd}" launch.py $args
if [ $? != 0 ]
then
printf "Error occurred"
exit 1
fi
start
}
# python3 executable
if [[ -z $python_cmd ]]
then
python_cmd="python3"
fi
if [ -z $skip_pip ]
then
skip_pip=false
fi
if [ -z $LANG ]
then
LANG=en
fi
if [ -z $FORMAT ]
then
FORMAT=csv
fi
if [ -z $ALLFORMAT ]
then
ALLFORMAT=false
fi
if [ -z $OUTPUT_DIR ]
then
OUTPUT_DIR=./
fi
if [ -z $mjai ]
then
mjai=false
fi
if [ $ALLFORMAT = true ]
then args="-l $LANG --all-formats -o $OUTPUT_DIR"
else args="-l $LANG -f $FORMAT -o $OUTPUT_DIR"
fi
if [ $mjai = true ]
then args="$args --mjai"
fi
if [ $skip_pip = true ]
then
start
else
check_pip
fi