Skip to content

Instantly share code, notes, and snippets.

@btobolaski
Created October 9, 2012 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save btobolaski/3860391 to your computer and use it in GitHub Desktop.
Save btobolaski/3860391 to your computer and use it in GitHub Desktop.
A script to deal with Drafts' App folder in dropbox. I don't like how it uses a special folder in Dropbox. I wish that I could just set the folder to whatever I want. So what I do is check whether a file exists in my notes directory, if it does, it adds t
#!/bin/bash
DRAFTS_DIR=~/Dropbox/Apps/Drafts/*
NOTES_DIR=~/Dropbox/Notes
for file in $DRAFTS_DIR
do
FILENAME=$(basename "$file")
if [ "$FILENAME" != "Journal.txt" ]; then
if [ -f $NOTES_DIR/"$FILENAME" ]; then
echo "" >> $NOTES_DIR/"$FILENAME"
cat "$file" >> $NOTES_DIR/"$FILENAME"
rm -f "$file"
else
mv "$file" $NOTES_DIR
fi
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment