From 85f46e01b1e3add9a82bc28bdee66aea47012044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacek=20Sowi=C5=84ski?= Date: Fri, 17 Mar 2017 19:16:40 +0100 Subject: [PATCH] Don't overwrite silently on symlink conflicts Symlink conflicts are now handled in similar fashion as normal file-conflicts. --- lib/homesick/actions/file_actions.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/homesick/actions/file_actions.rb b/lib/homesick/actions/file_actions.rb index 255010a..5764f67 100644 --- a/lib/homesick/actions/file_actions.rb +++ b/lib/homesick/actions/file_actions.rb @@ -68,8 +68,10 @@ module Homesick "#{destination} exists and points to #{destination.readlink}", :red - FileUtils.rm destination - FileUtils.ln_s source, destination, force: true unless options[:pretend] + if collision_accepted?(destination, source) + FileUtils.rm destination + FileUtils.ln_s source, destination, force: true unless options[:pretend] + end when :conflict say_status :conflict, "#{destination} exists", :red