DEV: Better error handling for s3 task

This commit is contained in:
Robin Ward 2020-04-29 12:54:22 -04:00
parent cbb27241c4
commit 9ec908950d
1 changed files with 6 additions and 1 deletions

View File

@ -71,7 +71,12 @@ def assets
manifest.assets.each do |_, path|
fullpath = (Rails.root + "public/assets/#{path}").to_s
content_type = MiniMime.lookup_by_filename(fullpath).content_type
mime = MiniMime.lookup_by_filename(fullpath)
if mime.nil?
STDERR.puts "ERROR: could not determine mime type for #{fullpath}"
end
content_type = mime.content_type
asset_path = "assets/#{path}"
results << [fullpath, asset_path, content_type]