diff options
Diffstat (limited to 'gemfeed/convert-notes-to-pdfs.sh')
| -rwxr-xr-x | gemfeed/convert-notes-to-pdfs.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gemfeed/convert-notes-to-pdfs.sh b/gemfeed/convert-notes-to-pdfs.sh new file mode 100755 index 00000000..9b5a6708 --- /dev/null +++ b/gemfeed/convert-notes-to-pdfs.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +convert () { + find . -name \*.note \ + | while read -r note; do + echo supernote-tool convert -a -t pdf "$note" "${note/.note/.pdf}" + supernote-tool convert -a -t pdf "$note" "${note/.note/.pdf}.tmp" + mv "${note/.note/.pdf}.tmp" "${note/.note/.pdf}" + du -hs "$note" "${note/.note/.pdf}" + echo + done +} + +# Mage the PDFs available on my Phone as well +copy () { + if [ ! -d ~/Documents/Supernote ]; then + echo "Directory ~/Documents/Supernote does not exist, skipping" + exit 1 + fi + + rsync -delete -av --include='*/' --include='*.pdf' --exclude='*' . ~/Documents/Supernote/ + echo This was copied from $(pwd) so dont edit manually >~/Documents/Supernote/README.txt +} + +convert +copy |
