Enhance output. Fix new file size check.
This commit is contained in:
11
convert.sh
11
convert.sh
@@ -43,8 +43,8 @@ function insert {
|
|||||||
|
|
||||||
# Compile all the snippets into one Markdown file.
|
# Compile all the snippets into one Markdown file.
|
||||||
function combine {
|
function combine {
|
||||||
logs "Combining documents based on parameters '`echo $@`'."
|
|
||||||
ebook="$1.md"
|
ebook="$1.md"
|
||||||
|
logs "Combining documents to create '$ebook'."
|
||||||
shift
|
shift
|
||||||
for addition in "$@"; do
|
for addition in "$@"; do
|
||||||
insert "$addition" "$ebook"
|
insert "$addition" "$ebook"
|
||||||
@@ -60,7 +60,7 @@ function convert {
|
|||||||
out_dir="$export_dir"
|
out_dir="$export_dir"
|
||||||
ebook="${source//.md/.pdf}"
|
ebook="${source//.md/.pdf}"
|
||||||
|
|
||||||
logs "Creating '$out_dir/$ebook' from '$source'."
|
logs "Creating '$ebook' from '$source'."
|
||||||
|
|
||||||
book="${ebook//.pdf/-book.pdf}"
|
book="${ebook//.pdf/-book.pdf}"
|
||||||
booklet="${ebook//.pdf/-Booklet.pdf}"
|
booklet="${ebook//.pdf/-Booklet.pdf}"
|
||||||
@@ -99,12 +99,11 @@ function convert {
|
|||||||
|
|
||||||
## Cleanup ##
|
## Cleanup ##
|
||||||
|
|
||||||
log "Clean PDFs"
|
logs "Clean PDFs"
|
||||||
echo "Old:"
|
echo "Old:"
|
||||||
find "$DIR" -name "*".pdf -exec du -h {} \; -delete | sort -h
|
find "$DIR" -name "*".pdf -exec du -h {} \; -delete | sort -h
|
||||||
find "$export_dir" -name "*".pdf -exec du -h {} \; -delete | sort -h
|
|
||||||
|
|
||||||
log "Clean working directory '$work_dir'"
|
logs "Clean working directory '$work_dir'"
|
||||||
if [[ -e "$work_dir" ]]; then
|
if [[ -e "$work_dir" ]]; then
|
||||||
rm -rv "$work_dir"
|
rm -rv "$work_dir"
|
||||||
fi
|
fi
|
||||||
@@ -145,7 +144,7 @@ convert "$name.md" "(Server Only)"
|
|||||||
cd "$DIR"
|
cd "$DIR"
|
||||||
|
|
||||||
echo "New:"
|
echo "New:"
|
||||||
du -had1 *.pdf | sort -h
|
find "$DIR" -name "*".pdf -exec du -h {} \; | sort -h
|
||||||
|
|
||||||
date
|
date
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user