Created
July 16, 2011 09:11
-
-
Save jonasb/1086189 to your computer and use it in GitHub Desktop.
My dotfiles install script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# update git submodules | |
`git submodule init && git submodule update` | |
# update symlinks | |
# inspired by http://errtheblog.com/posts/89-huba-huba | |
home = File.expand_path('~') | |
Dir['*'].each do |file| | |
next if file =~ /install/ | |
target = File.join(home, ".#{file}") | |
if File.exists? target then | |
if File.symlink? target then | |
puts "Skipping .#{file} (already installed)" | |
else | |
puts "Skipping .#{file} (already exists)" | |
end | |
next | |
end | |
puts "Installing .#{file}" | |
`ln -s #{File.expand_path file} #{target}` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment