Commit db40a7c4 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Preserve warnings even if it passed

parent e57ad62d
...@@ -30,11 +30,12 @@ unless Rails.env.production? ...@@ -30,11 +30,12 @@ unless Rails.env.production?
lint:static_verification lint:static_verification
].each do |task| ].each do |task|
pid = Process.fork do pid = Process.fork do
rd, wr = IO.pipe rd_out, wr_out = IO.pipe
rd_err, wr_err = IO.pipe
stdout = $stdout.dup stdout = $stdout.dup
stderr = $stderr.dup stderr = $stderr.dup
$stdout.reopen(wr) $stdout.reopen(wr_out)
$stderr.reopen(wr) $stderr.reopen(wr_err)
begin begin
begin begin
...@@ -48,14 +49,13 @@ unless Rails.env.production? ...@@ -48,14 +49,13 @@ unless Rails.env.production?
ensure ensure
$stdout.reopen(stdout) $stdout.reopen(stdout)
$stderr.reopen(stderr) $stderr.reopen(stderr)
wr.close wr_out.close
wr_err.close
if msg warn "\n#{msg}\n\n" if msg
warn "\n#{msg}\n\n"
IO.copy_stream(rd, $stderr) IO.copy_stream(rd_out, $stdout)
else IO.copy_stream(rd_err, $stderr)
IO.copy_stream(rd, $stdout)
end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment