fix log command
parent
3ecfdf6aed
commit
2ad98e94ff
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue