From 1041cb51607578f077a9038bdfdaf20c87e6040c Mon Sep 17 00:00:00 2001 From: Mathieu Sauve-Frankel Date: Mon, 21 Jun 2010 21:48:44 -0700 Subject: [PATCH] make homesick symlink respect the force option Signed-off-by: Joshua Nichols --- lib/homesick/actions.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/homesick/actions.rb b/lib/homesick/actions.rb index 2e6b6ea..3b7702a 100644 --- a/lib/homesick/actions.rb +++ b/lib/homesick/actions.rb @@ -69,14 +69,14 @@ class Homesick else say_status :conflict, "#{destination} exists and points to #{destination.readlink}", :red unless options[:quiet] - if shell.file_collision(destination) { source } + if options[:force] or shell.file_collision(destination) { source } system "ln -sf #{source} #{destination}" unless options[:pretend] end end elsif destination.exist? say_status :conflict, "#{destination} exists", :red unless options[:quiet] - if shell.file_collision(destination) { source } + if options[:force] or shell.file_collision(destination) { source } system "ln -sf #{source} #{destination}" unless options[:pretend] end else