Merge pull request #83 from thenickperson/remove-duplicate-methods
Remove duplicate methods rm and rm_link
This commit is contained in:
@@ -102,22 +102,6 @@ class Homesick
|
|||||||
end
|
end
|
||||||
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 rm(file)
|
|
||||||
say_status "rm #{file}", '', :green unless options[:quiet]
|
|
||||||
system "rm #{file}" if File.exists?(file)
|
|
||||||
end
|
|
||||||
|
|
||||||
def rm_rf(dir)
|
def rm_rf(dir)
|
||||||
say_status "rm -rf #{dir}", '', :green unless options[:quiet]
|
say_status "rm -rf #{dir}", '', :green unless options[:quiet]
|
||||||
system "rm -rf #{dir}"
|
system "rm -rf #{dir}"
|
||||||
@@ -136,7 +120,7 @@ class Homesick
|
|||||||
|
|
||||||
def rm(file)
|
def rm(file)
|
||||||
say_status "rm #{file}", '', :green unless options[:quiet]
|
say_status "rm #{file}", '', :green unless options[:quiet]
|
||||||
system "rm #{file}"
|
system "rm #{file}" if File.exists?(file)
|
||||||
end
|
end
|
||||||
|
|
||||||
def rm_r(dir)
|
def rm_r(dir)
|
||||||
|
|||||||
Reference in New Issue
Block a user