'jekyll clean': also remove .sass-cache

This commit is contained in:
Parker Moore 2016-03-11 10:04:36 -08:00
parent 8c9ebd2674
commit 79f8210fff
1 changed files with 10 additions and 12 deletions

View File

@ -19,21 +19,19 @@ module Jekyll
options = configuration_from_options(options) options = configuration_from_options(options)
destination = options['destination'] destination = options['destination']
metadata_file = File.join(options['source'], '.jekyll-metadata') metadata_file = File.join(options['source'], '.jekyll-metadata')
sass_cache = File.join(options['source'], '.sass-cache')
if File.directory? destination remove(destination, checker_func: :directory?)
Jekyll.logger.info "Cleaning #{destination}..." remove(metadata_file, checker_func: :file?)
FileUtils.rm_rf(destination) remove(sass_cache, checker_func: :directory?)
Jekyll.logger.info "", "done."
else
Jekyll.logger.info "Nothing to do for #{destination}."
end end
if File.file? metadata_file def remove(filename, checker_func: :file?)
Jekyll.logger.info "Removing #{metadata_file}..." if File.public_send(checker_func, filename)
FileUtils.rm_rf(metadata_file) Jekyll.logger.info "Cleaner:", "Removing #{filename}..."
Jekyll.logger.info "", "done." FileUtils.rm_rf(filename)
else else
Jekyll.logger.info "Nothing to do for #{metadata_file}." Jekyll.logger.info "Cleaner:", "Nothing to do for #{filename}."
end end
end end
end end