lib/phase/util/shell.rb in phase-0.0.17 vs lib/phase/util/shell.rb in phase-1.0.0.rc1

- old
+ new

@@ -2,13 +2,20 @@ module Util module Shell include Console def shell(*args) + options = args.extract_options! + options.reverse_merge({ + allow_failure: false + }) + log "running: #{args.join(' ')}" - status = !!system(*args) - yield $? unless status - return status + succeeded = !!system(*args) || options[:allow_failure] + + yield $? unless succeeded + + succeeded end end end end