Merge pull request #266 from duhanebel/install_link_fix

Fix a bug that's causing the installer to overwrite backup files
This commit is contained in:
Yan Pritzker 2013-03-21 15:04:52 -07:00
commit c2a4b2cf88

View File

@ -173,7 +173,7 @@ def file_operation(files, method = :symlink)
puts "Source: #{source}"
puts "Target: #{target}"
if File.exists?(target) || File.symlink?(target)
if File.exists?(target) && (!File.symlink?(target) || (File.symlink?(target) && File.readlink(target) != source))
puts "[Overwriting] #{target}...leaving original at #{target}.backup..."
run %{ mv "$HOME/.#{file}" "$HOME/.#{file}.backup" }
end