Class: Homey::Tasks

Inherits:
Thor
  • Object
show all
Defined in:
lib/homey/tasks.rb

Instance Method Summary collapse

Instance Method Details



6
7
8
9
10
11
12
13
14
15
# File 'lib/homey/tasks.rb', line 6

def create_symlinks
  opts = { flavor: options[:flavor], flavorized_attributes: %w(target) }
  symlinks = Flavorizer::flavorize_group(home_file["sym_links"], opts)
  symlinks.each do |sym|
    paths = replace_home_char(sym['target'], sym['link'])
    target, link = absolutize_paths(*paths)
    FileUtils.rm_rf(link) if options[:force]
    File.symlink target, link
  end
end

#setupObject



18
19
20
# File 'lib/homey/tasks.rb', line 18

def setup
  home_file["commands"].each { |command| system command }
end