Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit c752ce06cb7948304b8443efee0464d30a10ff10 1 parent 2f576c6
Daniel Spiewak djspiewak authored

Showing 1 changed file with 6 additions and 5 deletions. Show diff stats Hide diff stats

  1. +6 5 lib/buildr/core/util.rb
11 lib/buildr/core/util.rb
@@ -314,11 +314,12 @@ def to_java_properties
314 314
315 315 module Buildr
316 316 class ProcessStatus
317   - attr_reader :pid, :termsig, :stopsig
  317 + attr_reader :pid, :termsig, :stopsig, :exitstatus
318 318
319   - def initialize(pid, success)
  319 + def initialize(pid, success, exitstatus)
320 320 @pid = pid
321 321 @success = success
  322 + @exitstatus = exitstatus
322 323
323 324 @termsig = nil
324 325 @stopsig = nil
@@ -395,12 +396,12 @@ def sh(*cmd, &block)
395 396 args = if cmd.size > 1 then cmd[1..cmd.size] else [] end
396 397
397 398 res = if Buildr::Util.win_os? && cmd.size == 1
398   - __native_system__("#{cd} call #{cmd.first}") == 0
  399 + __native_system__("#{cd} call #{cmd.first}")
399 400 else
400 401 arg_str = args.map { |a| "'#{a}'" }
401   - __native_system__(cd + cmd.first + ' ' + arg_str.join(' ')) == 0
  402 + __native_system__(cd + cmd.first + ' ' + arg_str.join(' '))
402 403 end
403   - $? = Buildr::ProcessStatus.new(0, res) # KLUDGE
  404 + $? = Buildr::ProcessStatus.new(0, res == 0, res) # KLUDGE
404 405
405 406 block.call(res, $?)
406 407 end

0 comments on commit c752ce0

Please sign in to comment.
Something went wrong with that request. Please try again.