Skip to content

A platform for community discussion. Free, open, simple.

FIX: `s3:upload_assets` was uploaded some source maps twice (#30216)

Alan Guo Xiang Tan49e835395966
diff --git a/lib/tasks/s3.rake b/lib/tasks/s3.rake
index 39ec32b3364..d01bd09ee71 100644
--- a/lib/tasks/s3.rake
+++ b/lib/tasks/s3.rake
@@ -61,7 +61,7 @@ def assets
Rails.application.config.assets.manifest,
)
- results = []
+ results = Set.new
manifest.assets.each do |_, path|
fullpath = (Rails.root + "public/assets/#{path}").to_s
@@ -69,6 +69,7 @@ def assets
# Ignore files we can't find the mime type of, like yarn.lock
content_type = MiniMime.lookup_by_filename(fullpath)&.content_type
content_type ||= "application/json" if fullpath.end_with?(".map")
+
if content_type
asset_path = "assets/#{path}"
results << [fullpath, asset_path, content_type]
@@ -87,7 +88,7 @@ def assets
end
end
- results
+ results.to_a
end
def asset_paths