]> git.donarmstrong.com Git - bin.git/commitdiff
delete the annot file if it has size 0
authorDon Armstrong <don@donarmstrong.com>
Thu, 5 Jan 2017 19:23:35 +0000 (11:23 -0800)
committerDon Armstrong <don@donarmstrong.com>
Thu, 5 Jan 2017 19:23:35 +0000 (11:23 -0800)
dropbox_to_read

index 7ea896ad6886801a2866356f1d3a815ca9af5bcc..be05ca0877bc759c480bf8c476d47df9f2117a70 100755 (executable)
@@ -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"