Method: Consist::Step#shell
- Defined in:
- lib/consist/step.rb
#shell(message = "", params: {}) ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/consist/step.rb', line 37 def shell( = "", params: {}) return unless block_given? command = yield commands = command.split(/(?<!\\)\n/).select { !_1.start_with?("#") }.compact @commands << {message:, type: :exec, commands:, params:} end |