delete nested site_files when directory is deleted

This commit is contained in:
Kyle Drake 2015-02-13 11:54:18 -08:00
parent e6aaba74fb
commit fbe00f6f9c
3 changed files with 23 additions and 4 deletions

View file

@ -659,6 +659,11 @@ class Site < Sequel::Model
begin
FileUtils.rm files_path(path)
rescue Errno::EISDIR
site_files.each do |site_file|
if site_file.path.match /^#{path}\//
site_file.destroy
end
end
FileUtils.remove_dir files_path(path), true
rescue Errno::ENOENT
end