-
Notifications
You must be signed in to change notification settings - Fork 1
/
bake
executable file
·68 lines (61 loc) · 4.24 KB
/
bake
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
66
67
68
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
usage="bake -b <bookname> -i <inputfile> -o <outputfile>"
# Get command line arguments
while getopts b:i:o:h flag
do
case "${flag}" in
b) book=${OPTARG} ;;
i) input_file=${OPTARG} ;;
o) output_file=${OPTARG} ;;
h) echo $usage; exit 0 ;;
*) echo "Unknown flag '${flag}'"; exit 1 ;;
esac
done
# Call the baking script based on the book; books will probably have the same
# calling syntax, but maybe not so don't try to reduce duplication here.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
case "${book}" in
accounting) $DIR/books/accounting/bake --input $input_file --output $output_file;;
additive-manufacturing) $DIR/books/additive-manufacturing/bake --input $input_file --output $output_file;;
american-government) $DIR/books/american-government/bake --input $input_file --output $output_file;;
anatomy) $DIR/books/anatomy/bake --input $input_file --output $output_file;;
anthropology) $DIR/books/anthropology/bake --input $input_file --output $output_file;;
ap-biology) $DIR/books/ap-biology/bake --input $input_file --output $output_file;;
ap-history) $DIR/books/ap-history/bake --input $input_file --output $output_file;;
astronomy) $DIR/books/astronomy/bake --input $input_file --output $output_file;;
bca) $DIR/books/bca/bake --input $input_file --output $output_file;;
biology) $DIR/books/biology/bake --input $input_file --output $output_file;;
business-ethics) $DIR/books/business-ethics/bake --input $input_file --output $output_file;;
calculus) $DIR/books/calculus/bake --input $input_file --output $output_file;;
chemistry) $DIR/books/chemistry/bake --input $input_file --output $output_file;;
college-physics) $DIR/books/college-physics/bake --input $input_file --output $output_file;;
college-success) $DIR/books/college-success/bake --input $input_file --output $output_file;;
computer-science) $DIR/books/computer-science/bake --input $input_file --output $output_file;;
contemporary-math) $DIR/books/contemporary-math/bake --input $input_file --output $output_file;;
dev-math) $DIR/books/dev-math/bake --input $input_file --output $output_file;;
dummy) $DIR/books/dummy/bake --input $input_file --output $output_file;;
economics) $DIR/books/economics/bake --input $input_file --output $output_file;;
english-composition) $DIR/books/english-composition/bake --input $input_file --output $output_file;;
entrepreneurship) $DIR/books/entrepreneurship/bake --input $input_file --output $output_file;;
finance) $DIR/books/finance/bake --input $input_file --output $output_file;;
history) $DIR/books/history/bake --input $input_file --output $output_file;;
hs-physics) $DIR/books/hs-physics/bake --input $input_file --output $output_file;;
intro-business) $DIR/books/intro-business/bake --input $input_file --output $output_file;;
microbiology) $DIR/books/microbiology/bake --input $input_file --output $output_file;;
philosophy) $DIR/books/philosophy/bake --input $input_file --output $output_file;;
pl-economics) $DIR/books/pl-economics/bake --input $input_file --output $output_file;;
pl-psychology) $DIR/books/pl-psychology/bake --input $input_file --output $output_file;;
pl-u-physics) $DIR/books/pl-u-physics/bake --input $input_file --output $output_file;;
political-science) $DIR/books/political-science/bake --input $input_file --output $output_file;;
precalculus) $DIR/books/precalculus/bake --input $input_file --output $output_file;;
precalculus-coreq) $DIR/books/precalculus-coreq/bake --input $input_file --output $output_file;;
principles-management) $DIR/books/principles-management/bake --input $input_file --output $output_file;;
psychology) $DIR/books/psychology/bake --input $input_file --output $output_file;;
sociology) $DIR/books/sociology/bake --input $input_file --output $output_file;;
statistics) $DIR/books/statistics/bake --input $input_file --output $output_file;;
u-physics) $DIR/books/u-physics/bake --input $input_file --output $output_file;;
world-history) $DIR/books/world-history/bake --input $input_file --output $output_file;;
ap-physics) $DIR/books/ap-physics/bake --input $input_file --output $output_file;;
*) echo "Unknown book '${book}'"; exit 1;;
esac