lib/terragov/cleaner.rb in terragov-0.2.4 vs lib/terragov/cleaner.rb in terragov-0.2.5
- old
+ new
@@ -23,10 +23,16 @@
unless force
next unless HighLine.agree('Do you wish to delete?')
end
files.each do |file|
- File.delete(File.expand_path(file))
+ file = File.expand_path(file)
+ if Dir.exist?(file)
+ # No way to force delete with native Ruby Dir class
+ system("rm -rf #{file}")
+ else
+ File.delete(file)
+ end
end
puts 'Done'
end
end
end