From b4168217a4f81e6470afe427bf355061fb37a473 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Tue, 17 Sep 2019 06:33:31 +0900 Subject: [PATCH] Sort manifest entries alphabetically before choosing one --- lib/sprockets/manifest_utils.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/sprockets/manifest_utils.rb b/lib/sprockets/manifest_utils.rb index c115c6e29..703fa1f6e 100644 --- a/lib/sprockets/manifest_utils.rb +++ b/lib/sprockets/manifest_utils.rb @@ -38,6 +38,7 @@ def find_directory_manifest(dirname, logger = Logger.new($stderr)) entries = File.directory?(dirname) ? Dir.entries(dirname) : [] manifest_entries = entries.select { |e| e =~ MANIFEST_RE } if manifest_entries.length > 1 + manifest_entries.sort! logger.warn("Found multiple manifests: #{manifest_entries}. Choosing the first alphabetically: #{manifest_entries.first}") end entry = manifest_entries.first || generate_manifest_path