Created
August 11, 2010 18:05
-
-
Save ryanflorence/519420 to your computer and use it in GitHub Desktop.
CLI + TextMate todo list management
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # place or symlink this script somewhere in your path and then | |
| # | |
| # $ todo category long description of task | |
| # | |
| # todo script creates a new file and opens it up in textmate | |
| # take back your task manager, geeks! | |
| Dir.chdir('/path/to/todo/directory/') | |
| category = ARGV.shift | |
| title = ARGV.join(' ') | |
| filename = "#{category}/#{title}.todo" | |
| doc = "--- | |
| title: #{title} | |
| category: #{category} | |
| created_at: #{Time.now} | |
| --- | |
| " | |
| Dir.mkdir(category) unless File.exists?(category) | |
| File.open(filename, 'w') {|f| f.write(doc) } | |
| `mate "#{filename}"` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment