summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-05-05 03:19:05 -0700
committerStan Hu <stanhu@gmail.com>2019-05-05 03:24:28 -0700
commita5620a0d2332b2313849f87af802bfb5c9f7ff3f (patch)
tree95823e1a34114617e50cdd88d32a13659a63e894
parent525a9f927c7096c223cededa0684cf16e488a034 (diff)
downloadgitlab-ce-a5620a0d2332b2313849f87af802bfb5c9f7ff3f.tar.gz
Revert changes in lib/tasks/lint.rake
-rw-r--r--lib/tasks/lint.rake17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/tasks/lint.rake b/lib/tasks/lint.rake
index 7aab53491e6..c5d0f2c292f 100644
--- a/lib/tasks/lint.rake
+++ b/lib/tasks/lint.rake
@@ -36,9 +36,14 @@ unless Rails.env.production?
gettext:updated_check
lint:static_verification
].each do |task|
- warn "#{Time.now} Running #{task}\n"
-
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
Rake::Task[task].invoke
rescue SystemExit => ex
@@ -48,7 +53,15 @@ unless Rails.env.production?
msg = "*** Rake task #{task} raised #{ex.class}:"
raise ex
ensure
+ $stdout.reopen(stdout)
+ $stderr.reopen(stderr)
+ wr_out.close
+ wr_err.close
+
warn "\n#{msg}\n\n" if msg
+
+ IO.copy_stream(rd_out, $stdout)
+ IO.copy_stream(rd_err, $stderr)
end
end