mirror of
https://github.com/discourse/discourse.git
synced 2025-06-12 23:53:50 +08:00
assets rake task: only try and detect brotli if COMPRESS_BROTLI is set
This commit is contained in:
@ -115,6 +115,7 @@ def gzip(path)
|
|||||||
raise "gzip compression failed: exit code #{$?.exitstatus}" if $?.exitstatus != 0
|
raise "gzip compression failed: exit code #{$?.exitstatus}" if $?.exitstatus != 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if ENV['COMPRESS_BROTLI']&.to_i == 1
|
||||||
# different brotli versions use different parameters
|
# different brotli versions use different parameters
|
||||||
ver_out, ver_err, ver_status = Open3.capture3('brotli --version')
|
ver_out, ver_err, ver_status = Open3.capture3('brotli --version')
|
||||||
if !ver_status.success?
|
if !ver_status.success?
|
||||||
@ -130,6 +131,7 @@ else
|
|||||||
# not sure what to do here, not expecting this
|
# not sure what to do here, not expecting this
|
||||||
raise "cannot determine brotli version"
|
raise "cannot determine brotli version"
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def brotli(path)
|
def brotli(path)
|
||||||
if ENV['COMPRESS_BROTLI']&.to_i == 1
|
if ENV['COMPRESS_BROTLI']&.to_i == 1
|
||||||
|
Reference in New Issue
Block a user