Add unlink functionality

This commit is contained in:
Trae Robrock
2013-07-16 20:50:36 -07:00
parent bfce04e63c
commit 4b38eb848f
3 changed files with 130 additions and 2 deletions

View File

@@ -97,6 +97,17 @@ class Homesick
end
end
def rm_link(target)
target = Pathname.new(target)
if target.symlink?
say_status :unlink, "#{target.expand_path}", :green unless options[:quiet]
FileUtils.rm_rf target
else
say_status :conflict, "#{target} is not a symlink", :red unless options[:quiet]
end
end
def ln_s(source, destination, config = {})
source = Pathname.new(source)
destination = Pathname.new(destination)