Skip to content

Commit

Permalink
Add install script
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanp committed Sep 16, 2014
1 parent 183b0ca commit aac7cbc
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions install.rb
@@ -0,0 +1,19 @@
require 'fileutils'

excluded = ['.', '..', '.git', '.gitignore']

home = File.expand_path('~')
Dir.glob(".*").reject { |f| excluded.include?(f) }.each do |file|
homefile = File.join(home, file)

if File.exists?(homefile)
FileUtils.mv(homefile, homefile + '.old')
end

if File.symlink?(homefile)
FileUtils.rm(homefile)
end

FileUtils.ln_s(File.expand_path("./#{file}"), homefile)
end

0 comments on commit aac7cbc

Please sign in to comment.