forked from chyyuu/simple_os_book
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makepdfs
45 lines (35 loc) · 846 Bytes
/
makepdfs
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
#!/bin/bash
baseDir=`dirname $0`
outputDir=${baseDir}/pdf
exclude=('figures' 'figures-dia' 'figures-source' 'latex' 'makepdfs' 'pdf' 'README')
dirContent=`ls $baseDir`
argString=""
echo $i;
for dir in $dirContent; do
if [ -n $dir ]; then
isLang=1
for i in ${exclude[@]}; do
if [ $i == $dir ]; then
isLang=0
fi
done
if [ $isLang -eq 1 ]; then
if [ "$1" = "" ]; then
argString="${argString} ${dir}"
else
for i in ${@}; do
if [ $i = $dir ]; then
argString="${argString} ${dir}"
fi
done
fi
fi
fi
done
echo "Will generate pdf for the following languages:"
echo " "$argString
mkdir -p $outputDir
echo
echo "The generation process will start now."
${baseDir}/latex/makepdf $argString
# pdftk A=ebooks/cover.pdf B=kaiyuanbook.zh.pdf cat A1 B2-end output kaiyuanbook.zh.book.pdf