Class: Infect::Command::Prereqs

Inherits:
Infect::Command show all
Defined in:
lib/infect/command/prereqs.rb

Instance Method Summary collapse

Methods inherited from Infect::Command

build

Methods included from Infect::Colorize

#colorize, #error, #notice

Instance Method Details

#callObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/infect/command/prereqs.rb', line 10

def call
  mkdir PACK_DIR
  # create the cache directories for sensible.vim:
  # TODO: Support Windows
  if RUBY_PLATFORM =~ /darwin/
    mkdirs %w(~/Library/Vim/swap ~/Library/Vim/backup ~/Library/Vim/undo)
  else
    mkdirs %w(~/.local/share/vim/swap ~/.local/share/vim/backup ~/.local/share/vim/undo")
  end
end

#mkdirs(list) ⇒ Object



5
6
7
8
9
# File 'lib/infect/command/prereqs.rb', line 5

def mkdirs(list)
  list.each do |path|
    FileUtils.mkdir_p(File.expand_path(path))
  end
end