public
Description: bash, git, vim, irb, rails, sake
Clone URL: git://github.com/mislav/dotfiles.git
Search Repo:
dotfiles / install.rb
100755 18 lines (13 sloc) 0.389 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env ruby
 
# from http://errtheblog.com/posts/89-huba-huba
 
home = ENV['HOME']
 
Dir.chdir File.dirname(__FILE__) do
  dotfiles_dir = Dir.pwd.sub(home + '/', '')
  
  Dir['*'].each do |file|
    next if file == 'install.rb'
    target = File.join(home, ".#{file}")
    unless File.exist? target
      system %[ln -vsf #{File.join(dotfiles_dir, file)} #{target}]
    end
  end
end