From 3c60702663c49cb40da8bc0732c010f27c91373c Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Fri, 24 Nov 2017 09:52:08 -0500 Subject: [PATCH] assets rake task: gzip and brotli exit codes exist for a reason - to be checked --- lib/tasks/assets.rake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake index 9029f9cf4b5..d27b2242272 100644 --- a/lib/tasks/assets.rake +++ b/lib/tasks/assets.rake @@ -109,15 +109,18 @@ def compress_ruby(from, to) end def gzip(path) - STDERR.puts "gzip #{path}" + STDERR.puts "gzip -f -c -9 #{path} > #{path}.gz" STDERR.puts `gzip -f -c -9 #{path} > #{path}.gz` + raise "gzip compression failed: exit code #{$?.exitstatus}" if $?.exitstatus != 0 end def brotli(path) if ENV['COMPRESS_BROTLI']&.to_i == 1 - STDERR.puts "brotli #{path}" + STDERR.puts "brotli --quality 11 --input #{path} --output #{path}.br" STDERR.puts `brotli --quality 11 --input #{path} --output #{path}.br` + raise "brotli compression failed: exit code #{$?.exitstatus}" if $?.exitstatus != 0 STDERR.puts `chmod +r #{path}.br` + raise "chmod failed: exit code #{$?.exitstatus}" if $?.exitstatus != 0 end end