Commit a5620a0d authored by Stan Hu's avatar Stan Hu

Revert changes in lib/tasks/lint.rake

parent 525a9f92
...@@ -36,9 +36,14 @@ unless Rails.env.production? ...@@ -36,9 +36,14 @@ unless Rails.env.production?
gettext:updated_check gettext:updated_check
lint:static_verification lint:static_verification
].each do |task| ].each do |task|
warn "#{Time.now} Running #{task}\n"
pid = Process.fork do pid = Process.fork do
rd_out, wr_out = IO.pipe
rd_err, wr_err = IO.pipe
stdout = $stdout.dup
stderr = $stderr.dup
$stdout.reopen(wr_out)
$stderr.reopen(wr_err)
begin begin
Rake::Task[task].invoke Rake::Task[task].invoke
rescue SystemExit => ex rescue SystemExit => ex
...@@ -48,7 +53,15 @@ unless Rails.env.production? ...@@ -48,7 +53,15 @@ unless Rails.env.production?
msg = "*** Rake task #{task} raised #{ex.class}:" msg = "*** Rake task #{task} raised #{ex.class}:"
raise ex raise ex
ensure ensure
$stdout.reopen(stdout)
$stderr.reopen(stderr)
wr_out.close
wr_err.close
warn "\n#{msg}\n\n" if msg warn "\n#{msg}\n\n" if msg
IO.copy_stream(rd_out, $stdout)
IO.copy_stream(rd_err, $stderr)
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