mirror of
https://github.com/neocities/neocities.git
synced 2025-07-20 17:46:05 +02:00
delete nested site_files when directory is deleted
This commit is contained in:
parent
e6aaba74fb
commit
fbe00f6f9c
3 changed files with 23 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue