Merge pull request #4652 from jekyll/clean-sass-cache
Merge pull request 4652
This commit is contained in:
		
						commit
						d4c1d97cb3
					
				|  | @ -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 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue