call unlink before removing the castle repo

This commit is contained in:
thilko
2013-11-23 21:06:41 +01:00
parent 69c38774fe
commit 640da07089

View File

@@ -233,18 +233,9 @@ class Homesick < Thor
check_castle_existance name, "destroy" check_castle_existance name, "destroy"
if shell.yes?("This will destroy your castle irreversible! Are you sure?") if shell.yes?("This will destroy your castle irreversible! Are you sure?")
inside castle_dir(name) do unlink(name)
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) rm_r castle_dir(name)
end end
end
end end