diff --git a/lib/jekyll/cleaner.rb b/lib/jekyll/cleaner.rb index b167f0a7..77c35345 100644 --- a/lib/jekyll/cleaner.rb +++ b/lib/jekyll/cleaner.rb @@ -9,12 +9,18 @@ module Jekyll # Cleans up the site's destination directory def cleanup! - obsolete_files = existing_files - new_files - new_dirs + replaced_files - FileUtils.rm_rf(obsolete_files.to_a) + FileUtils.rm_rf(obsolete_files) end private + # Private: The list of files and directories to be deleted during the cleanup process + # + # Returns an Array with the file and directory paths + def obsolete_files + (existing_files - new_files - new_dirs + replaced_files).to_a + end + # Private: The list of existing files, except those included in keep_files and hidden files. # # Returns a Set with the file paths