diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-01-24 16:05:01 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-01-26 14:42:48 +0300 |
commit | a2618310aea7d58e52d2d29ec4871e27717eb0f0 (patch) | |
tree | 63c943c0cd428e82955574f578ef55b5c166f1e6 /lib/gitlab/popen.rb | |
parent | 0bf918f05e827b380107d88f4592d1ceedd632f9 (diff) |
Use Process::Status rather than an integer
However keep backward compatibility
Diffstat (limited to 'lib/gitlab/popen.rb')
-rw-r--r-- | lib/gitlab/popen.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/popen.rb b/lib/gitlab/popen.rb index 05526a9ac94..b9832a724c4 100644 --- a/lib/gitlab/popen.rb +++ b/lib/gitlab/popen.rb @@ -11,7 +11,7 @@ module Gitlab def popen(cmd, path = nil, vars = {}, &block) result = popen_with_detail(cmd, path, vars, &block) - [result.stdout << result.stderr, result.status] + [result.stdout << result.stderr, result.status&.exitstatus] end # Returns Result @@ -30,7 +30,7 @@ module Gitlab cmd_stdout = '' cmd_stderr = '' - cmd_status = 0 + cmd_status = nil start = Time.now Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr| @@ -39,7 +39,7 @@ module Gitlab cmd_stdout = stdout.read cmd_stderr = stderr.read - cmd_status = wait_thr.value.exitstatus + cmd_status = wait_thr.value end Result.new(cmd, cmd_stdout, cmd_stderr, cmd_status, Time.now - start) |