Class: Polka::Cli

Inherits:
Thor
  • Object
show all
Defined in:
lib/polka/cli.rb

Instance Method Summary collapse

Instance Method Details

#setup(home_dir = nil, dotfile_dir = nil) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/polka/cli.rb', line 4

def setup(home_dir=nil, dotfile_dir=nil)
  dotfile_path = dotfile_dir ? File.join(dotfile_dir, "Dotfile") : "Dotfile"
  home_path = home_dir || ENV['HOME']
  dotfile_path = File.expand_path(dotfile_path)
  home_path = File.expand_path(home_path)
  File.open(dotfile_path) { |the_dotfile| Bootstrapper.from_dotfile(the_dotfile, home_path).setup }
end