fix log command

master
muflax 2012-06-05 01:31:17 +02:00
parent 3ecfdf6aed
commit 2ad98e94ff
1 changed files with 8 additions and 2 deletions

View File

@ -5,9 +5,15 @@ description 'Opens new log entry in Emacs.'
module Nanoc::CLI::Commands
class CreateLog < ::Nanoc::CLI::CommandRunner
def run
page = daily_logs.last.gsub(/(\d+)/) {|s| s.to_i + 1}
site = load_site "daily"
logs = site.items_by_date.select do |i|
i.reps.any? {|r| r.name == :wordcount}
end
page = logs.last.identifier.gsub(/(\d+)/) {|s| s.to_i + 1}
puts "editing: #{page}..."
system "emacs-gui #{page}"
# system "emacs-gui #{page}"
end
end
end