Permalink
Browse files

Added exitstatus method to ProcessStatus

git-svn-id: https://svn.apache.org/repos/asf/buildr/trunk@792372 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 2f576c6 commit c752ce06cb7948304b8443efee0464d30a10ff10 @djspiewak djspiewak committed Jul 9, 2009
Showing with 6 additions and 5 deletions.
  1. +6 −5 lib/buildr/core/util.rb
@@ -314,11 +314,12 @@ def to_java_properties
module Buildr
class ProcessStatus
- attr_reader :pid, :termsig, :stopsig
+ attr_reader :pid, :termsig, :stopsig, :exitstatus
- def initialize(pid, success)
+ def initialize(pid, success, exitstatus)
@pid = pid
@success = success
+ @exitstatus = exitstatus
@termsig = nil
@stopsig = nil
@@ -395,12 +396,12 @@ def sh(*cmd, &block)
args = if cmd.size > 1 then cmd[1..cmd.size] else [] end
res = if Buildr::Util.win_os? && cmd.size == 1
- __native_system__("#{cd} call #{cmd.first}") == 0
+ __native_system__("#{cd} call #{cmd.first}")
else
arg_str = args.map { |a| "'#{a}'" }
- __native_system__(cd + cmd.first + ' ' + arg_str.join(' ')) == 0
+ __native_system__(cd + cmd.first + ' ' + arg_str.join(' '))
end
- $? = Buildr::ProcessStatus.new(0, res) # KLUDGE
+ $? = Buildr::ProcessStatus.new(0, res == 0, res) # KLUDGE
block.call(res, $?)
end

0 comments on commit c752ce0

Please sign in to comment.