From 995f1ed1bad6c1edd0822087be52c2b52b0be56c Mon Sep 17 00:00:00 2001 From: Aboobacker MK Date: Mon, 9 Dec 2019 17:21:29 +0530 Subject: [PATCH] Fix assets clean (#2391) File.exists? return true for directories and it is causing issue in assets clean step --- lib/webpacker/commands.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/webpacker/commands.rb b/lib/webpacker/commands.rb index 414e882a2..eb8c7a3e3 100644 --- a/lib/webpacker/commands.rb +++ b/lib/webpacker/commands.rb @@ -8,7 +8,7 @@ def initialize(webpacker) def clean(count = 2) if config.public_output_path.exist? && config.public_manifest_path.exist? && versions.count > count versions.drop(count).flat_map(&:last).each do |file| - File.delete(file) if File.exist?(file) + File.delete(file) if File.file?(file) logger.info "Removed #{file}" end end