Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 22 lines (14 sloc) 598 Bytes
#!/usr/bin/env ruby
# from http://errtheblog.com/posts/89-huba-huba, with local mods
require "fileutils"
home = File.expand_path "~"
Dir["*"].each do | file |
next if %w( bin install README.md ).include?(file)
## need to properly handle directories, that are already linked?
## currently, running this in ~/.dotfiles is adding a symlink inside each directory (that isn't `bin`)
target = File.join(home, ".#{file}")
if File.exists?(target) && !File.symlink?(target)
FileUtils.cp target, "#{target}.saved"
end
FileUtils.ln_s File.expand_path(file), target, force: true
end
Something went wrong with that request. Please try again.