Class: GithubPivotalFlow::Shell

Inherits:
Object
  • Object
show all
Defined in:
lib/github_pivotal_flow/shell.rb

Class Method Summary collapse

Class Method Details

.exec(command, abort_on_failure = true) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/github_pivotal_flow/shell.rb', line 3

def self.exec(command, abort_on_failure = true)
  result = `#{command}`
  if $?.exitstatus != 0 && abort_on_failure
    print "Failed command: #{command} "
    abort 'FAIL'
  end

  result
end