Module: Rake::Funnel::Extensions::Shell

Included in:
DSL
Defined in:
lib/rake/funnel/extensions/shell.rb

Instance Method Summary collapse

Instance Method Details

#shell(*cmd, log_file: nil, error_lines: nil, &block) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/rake/funnel/extensions/shell.rb', line 10

def shell(*cmd, log_file: nil, error_lines: nil, &block)
  mkdir_p(File.dirname(log_file)) if log_file

  run(cmd, log_file, error_lines) do |success, readable_cmd, result, log|
    if block
      block.call(success, readable_cmd, result, log)
      return
    end
  end
end