ttimsmith/Jekyll-Post-Automaters — pull request #2 by brockboland (2014-03-09 19:21:34+00:00)
Title: Append a number to the filename if it already exists

If you specify a title that results in a file path that already exists, that existing file just gets clobbered.

This adds a loop that will check if the file exists already, and append a number to the filename if it does.

If you run "post Test Post" in Alfred three times, you'll get these three files:
- test-post.md
- test-post-1.md
- test-post-2.md

This actually removes the need to merge #1, since I removed the Dir.chdir in favor of just using the absolute path for the open command. And, like #1, Sublime Text also stripped a bunch of trailing whitespace.