Class: MacSetup::Plugins::Dotfiles

Inherits:
MacSetup::Plugin show all
Defined in:
lib/mac_setup/plugins/dotfiles.rb

Class Method Summary collapse

Methods inherited from MacSetup::Plugin

bootstrap, get_status, load, run

Class Method Details

.add_requirements(config) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/mac_setup/plugins/dotfiles.rb', line 5

def add_requirements(config)
  GitRepoInstaller.install_repo(config.dotfiles_repo, MacSetup.dotfiles_path)
  paths = [MacSetup.dotfiles_path]

  config.extra_dotfiles.each do |repo|
    path = File.expand_path("~/.#{repo.split('/').last}")
    paths << path
    GitRepoInstaller.install_repo(repo, path)
  end

  paths.each do |path|
    SymlinkPathBuilder.paths_for(path) do |source, target|
      config.add(:symlinks, source => target)
    end
  end
end