Skip to content
代码片段 群组 项目
提交 04490c1d 编辑于 作者: Martin Wortschack's avatar Martin Wortschack
浏览文件

Add Rainbow in bin/pngquant

上级 c5eb8157
No related branches found
No related tags found
无相关合并请求
...@@ -45,16 +45,16 @@ when 'lint' ...@@ -45,16 +45,16 @@ when 'lint'
uncompressed_files = Parallel.map(files) do |file| uncompressed_files = Parallel.map(files) do |file|
is_uncompressed, _ = Tooling::Image.compress_image(file, true) is_uncompressed, _ = Tooling::Image.compress_image(file, true)
if is_uncompressed if is_uncompressed
puts "Uncompressed file detected: ".color(:red) + file puts Rainbow("Uncompressed file detected: ").red + file
file file
end end
end.compact end.compact
if uncompressed_files.empty? if uncompressed_files.empty?
puts "All documentation images are optimally compressed!".color(:green) puts Rainbow("All documentation images are optimally compressed!").green
else else
warn( warn(
"The #{uncompressed_files.size} image(s) above have not been optimally compressed using pngquant.".color(:red), Rainbow("The #{uncompressed_files.size} image(s) above have not been optimally compressed using pngquant.").red,
'Please run "bin/pngquant compress" and commit the result.' 'Please run "bin/pngquant compress" and commit the result.'
) )
abort abort
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册