diff --git a/lib/asset_hat.rb b/lib/asset_hat.rb index d341e02..2dccdbb 100644 --- a/lib/asset_hat.rb +++ b/lib/asset_hat.rb @@ -233,8 +233,12 @@ def self.bundle_filepaths(bundle, type) dir = self.assets_dir(type) filenames = self.bundle_filenames(bundle, type) - filepaths = filenames.present? ? - filenames.map { |fn| File.join(dir, "#{fn}.#{type}") } : nil + return nil unless filenames.present? + + filenames.map do |fn| + paths = ["", ".#{type}"].map { |ext| File.join(dir, "#{fn}#{ext}") } + paths.find { |path| File.file?(path) } + end end # Reads ActionController::Base.asset_host, which can be a