From b2e4c918187a28b32a2c486305b683cd6f77f68d Mon Sep 17 00:00:00 2001 From: Rafael dos Santos Silva Date: Thu, 12 Aug 2021 14:20:05 -0300 Subject: [PATCH] DEV: Allow removing local assets after s3 sync (#14013) --- lib/tasks/s3.rake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/tasks/s3.rake b/lib/tasks/s3.rake index 7f6b0f79b9d..e775e5c260e 100644 --- a/lib/tasks/s3.rake +++ b/lib/tasks/s3.rake @@ -37,6 +37,8 @@ def upload(path, remote_path, content_type, content_encoding = nil) helper.upload(file, remote_path, options) end end + + File.delete(path) if (File.exists?(path) && ENV["DELETE_ASSETS_AFTER_S3_UPLOAD"]) end def use_db_s3_config