Skip to content

Commit 0dde354

Browse files
committed
Merge pull request #107 from opie4624/patch-1
Update 'rake post' to support tags on command line
2 parents 0f00bf5 + aeac709 commit 0dde354

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Rakefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ module JB
4040
end #Path
4141
end #JB
4242

43-
# Usage: rake post title="A Title" [date="2012-02-09"]
43+
# Usage: rake post title="A Title" [date="2012-02-09"] [tags=[tag1, tag2]]
4444
desc "Begin a new post in #{CONFIG['posts']}"
4545
task :post do
4646
abort("rake aborted: '#{CONFIG['posts']}' directory not found.") unless FileTest.directory?(CONFIG['posts'])
4747
title = ENV["title"] || "new-post"
48+
tags = ENV["tags"] || "[]"
4849
slug = title.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')
4950
begin
5051
date = (ENV['date'] ? Time.parse(ENV['date']) : Time.now).strftime('%Y-%m-%d')

0 commit comments

Comments
 (0)