Class: Work::Md::Commands::Annotations

Inherits:
Object
  • Object
show all
Defined in:
lib/work/md/commands/annotations.rb

Class Method Summary collapse

Class Method Details

.execute(_argv = []) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/work/md/commands/annotations.rb', line 8

def execute(_argv = [])
  file_name = 'annotations.md'
  work_dir = Work::Md::Config.work_dir

  ::FileUtils.mkdir_p(work_dir.to_s)

  unless ::File.exist?("#{work_dir}/#{file_name}")
    ::File.open("#{work_dir}/#{file_name}", 'w+') { |f| f.puts("# \n\n") }
  end

  Work::Md::File.open_in_editor([file_name])
end