diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-05-31 21:04:55 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-05-31 21:04:55 +0300 |
commit | db40a7c4e359052313b9a7bf104aa4e9586deada (patch) | |
tree | ded0ecba8bc6b6adb0b5c394648e40abd5f4c597 /lib | |
parent | e57ad62d488b15b9e65ea63f4ab78e51336318a5 (diff) |
Preserve warnings even if it passed
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tasks/lint.rake | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/tasks/lint.rake b/lib/tasks/lint.rake index fe5032cae18..8b86a5c72a5 100644 --- a/lib/tasks/lint.rake +++ b/lib/tasks/lint.rake @@ -30,11 +30,12 @@ unless Rails.env.production? lint:static_verification ].each do |task| pid = Process.fork do - rd, wr = IO.pipe + rd_out, wr_out = IO.pipe + rd_err, wr_err = IO.pipe stdout = $stdout.dup stderr = $stderr.dup - $stdout.reopen(wr) - $stderr.reopen(wr) + $stdout.reopen(wr_out) + $stderr.reopen(wr_err) begin begin @@ -48,14 +49,13 @@ unless Rails.env.production? ensure $stdout.reopen(stdout) $stderr.reopen(stderr) - wr.close + wr_out.close + wr_err.close - if msg - warn "\n#{msg}\n\n" - IO.copy_stream(rd, $stderr) - else - IO.copy_stream(rd, $stdout) - end + warn "\n#{msg}\n\n" if msg + + IO.copy_stream(rd_out, $stdout) + IO.copy_stream(rd_err, $stderr) end end |