diff options
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -45,7 +45,7 @@ task :post do abort("rake aborted: '#{CONFIG['posts']}' directory not found.") unless FileTest.directory?(CONFIG['posts']) title = ENV["title"] || "new-post" slug = title.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '') - date = ENV['date'] || Time.now.strftime('%Y-%m-%d') + date = (Time.parse(ENV['date']) || Time.now).strftime('%Y-%m-%d') filename = File.join(CONFIG['posts'], "#{date}-#{slug}.#{CONFIG['post_ext']}") if File.exist?(filename) abort("rake aborted!") if ask("#{filename} already exists. Do you want to overwrite?", ['y', 'n']) == 'n' |