Skip to content

Commit

Permalink
Fix assets clean (#2391)
Browse files Browse the repository at this point in the history
File.exists? return true for directories and it is causing issue in assets clean step
  • Loading branch information
tachyons authored and gauravtiwari committed Dec 9, 2019
1 parent 6bc19e7 commit 995f1ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/webpacker/commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 995f1ed

Please sign in to comment.