Add unlink functionality

This commit is contained in:
Trae Robrock
2013-07-16 20:50:36 -07:00
committed by thilko
parent 965b35b78c
commit b596e063f5
3 changed files with 130 additions and 2 deletions

View File

@@ -108,6 +108,17 @@ class Homesick
system "rm -rf #{dir}"
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)