From e3b0b42558d6ff2d6d9ab799c3db75f48932bf89 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Thu, 5 Jan 2017 11:23:35 -0800 Subject: [PATCH] delete the annot file if it has size 0 --- dropbox_to_read | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dropbox_to_read b/dropbox_to_read index 7ea896a..be05ca0 100755 --- a/dropbox_to_read +++ b/dropbox_to_read @@ -38,6 +38,10 @@ if [ "$(basename "$0")" == "dropbox_read" ]; then echo "${PDF_FILE}.annot"; (cd "$TMPDIR"; diff -Nura a b ) | qprint --encode --binary > "${PDF_FILE}.annot" + # delete the annot file if it has size 0 + if ! [ -s "${PDF_FILE}.annot" ]; then + rm -f "${PDF_FILE}.annot" + fi; rm -f "$TMPDIR/a/file.pdf" rm -f "$TMPDIR/b/file.pdf" rmdir "$TMPDIR/a" "$TMPDIR/b" "$TMPDIR" -- 2.39.2