lib/myosx/dotfiles.rb in myosx-0.2.1 vs lib/myosx/dotfiles.rb in myosx-0.2.2

- old
+ new

@@ -1,14 +1,16 @@ #!/usr/bin/env ruby - +# +# Pulls a dotfiles repo and symlinks the files where you specify +# require 'yaml' require 'git' require_relative 'config' class Dotfiles < Config - def initialize - @config = $global_config['dotfiles'] + def config + $global_config['dotfiles'] end def dotfiledir File.join($workspace, 'dotfiles') end @@ -39,14 +41,12 @@ puts "Linking #{source_file} to #{dest}" File.symlink(source_file, dest) end def exec - if @config['manage'] - if repo(@config['repo']) - @config['files'].each do |k, v| - link(k, v) - end + if repo(config['repo']) + config['files'].each do |k, v| + link(k, v) end end end end