Class: WorkMd::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



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

def execute(_argv = [])
  file_name = "annotations.md"
  work_dir = WorkMd::Config.work_dir

  ::FileUtils.mkdir_p("#{work_dir}")

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

  WorkMd::File.open_in_editor([file_name])
end