Skip to content

Commit

Permalink
Fix file matcher regex to avoid matching same file multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
tachyons committed Dec 3, 2019
1 parent 417542c commit 896c9fb
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 @@ -10,7 +10,7 @@ def clean(count_to_keep = 2)
files_in_manifest = process_manifest_hash(manifest.refresh)
files_to_be_removed = files_in_manifest.flat_map do |file_in_manifest|
file_prefix, file_ext = file_in_manifest.scan(/(.*)[0-9a-f]{20}(.*)/).first
versions_of_file = Dir.glob("#{file_prefix}*#{file_ext}").grep(/#{file_prefix}[0-9a-f]{20}#{file_ext}/)
versions_of_file = Dir.glob("#{file_prefix}*#{file_ext}").grep(/#{file_prefix}[0-9a-f]{20}#{file_ext}$/)
versions_of_file.map do |version_of_file|
next if version_of_file == file_in_manifest

Expand Down

0 comments on commit 896c9fb

Please sign in to comment.