Method: Consist::Commands::Mutate#perform!
- Defined in:
- lib/consist/commands/mutate.rb
#perform!(executor) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/consist/commands/mutate.rb', line 12 def perform!(executor) delim = @command[:delim] target_file = @command[:target_file] target_string = erb_template(@command[:target_string]) match = erb_template(@command[:match]) case @command[:mode] when :replace cmd = "sed -i -E 's#{delim}#{match}#{delim}#{target_string}#{delim}' #{target_file} " end executor.execute(cmd, interaction_handler: Consist::Commands::StreamLogger.new) end |