Fixing a bug that breaks the handling of collisions.
This commit is contained in:
@@ -75,7 +75,7 @@ module Homesick
|
|||||||
when :conflict
|
when :conflict
|
||||||
say_status :conflict, "#{destination} exists", :red unless options[:quiet]
|
say_status :conflict, "#{destination} exists", :red unless options[:quiet]
|
||||||
|
|
||||||
if collision_accepted?
|
if collision_accepted?(destination)
|
||||||
FileUtils.rm_r destination, force: true unless options[:pretend]
|
FileUtils.rm_r destination, force: true unless options[:pretend]
|
||||||
FileUtils.ln_s source, destination, force: true unless options[:pretend]
|
FileUtils.ln_s source, destination, force: true unless options[:pretend]
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -132,7 +132,8 @@ module Homesick
|
|||||||
first_p.mtime > second_p.mtime && !first_p.symlink?
|
first_p.mtime > second_p.mtime && !first_p.symlink?
|
||||||
end
|
end
|
||||||
|
|
||||||
def collision_accepted?
|
def collision_accepted?(destination)
|
||||||
|
fail "Argument must be an instance of Pathname, #{destination.class.name} given" unless destination.instance_of?(Pathname)
|
||||||
options[:force] || shell.file_collision(destination) { source }
|
options[:force] || shell.file_collision(destination) { source }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user