-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.sh
executable file
·32 lines (25 loc) · 939 Bytes
/
setup.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
#!/bin/bash
# Generate all files in the org folder and move them outside afterwards.
# The files are only generated if the org files are newer than we already have
for orgfile in ./org/*.org; do
# settings.org is used for inclusion in other to-be-generated org files.
if [[ $orgfile == *"settings.org"* ]]; then
continue
fi
# Don't regenerate files that are already up to date.
htmlfile=${orgfile/\.org/\.html}
if [[ `basename $htmlfile` -nt $orgfile ]]; then
continue
fi
# Generate html file from org file
emacs $orgfile --batch -f org-html-export-to-html
# Generate pdf files
pdffile=${htmlfile/\.html/\.pdf}
wkhtmltopdf $htmlfile $pdffile
done
# Move all generated stuff to the place that matters.
rsync -r ./org/* --exclude '*.org' .
# Cleanup.
rm ./org/*.html ./org/*.pdf
# Put all the generated content up for grabs.
tar -czvf circuite.tar.gz *.html *.pdf poze/