From 640da07089c3f03e9d39097aab1575e6be7c8d22 Mon Sep 17 00:00:00 2001 From: thilko Date: Sat, 23 Nov 2013 21:06:41 +0100 Subject: [PATCH] call unlink before removing the castle repo --- lib/homesick.rb | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/lib/homesick.rb b/lib/homesick.rb index 31119de..1049dca 100644 --- a/lib/homesick.rb +++ b/lib/homesick.rb @@ -233,17 +233,8 @@ class Homesick < Thor check_castle_existance name, "destroy" if shell.yes?("This will destroy your castle irreversible! Are you sure?") - inside castle_dir(name) do - files = Pathname.glob('{.*,*}').reject{|a| [".",".."].include?(a.to_s)} - files.each do |path| - - inside home_dir do - adjusted_path = (home_dir + path).basename - rm adjusted_path - end - end - rm_r castle_dir(name) - end + unlink(name) + rm_r castle_dir(name) end end