Method: IO#log_command

Defined in:
lib/react_native_util/core_ext/io.rb

#log_command(command) ⇒ Object

Logs a command to be executed by a call such as Kernel#system. If the command parameter is an Array, it will be joined using Array#shelljoin from shellwords. Otherwise it will be interpolated in a String.

Parameters:

  • command (Array, #to_s)

    A command to be logged

Returns:

  • nil



26
27
28
29
30
31
# File 'lib/react_native_util/core_ext/io.rb', line 26

def log_command(command)
  string_to_log = (command.kind_of?(Array) ? command.shelljoin : command)
  log "$ #{string_to_log}".cyan.bold
  flush
  nil
end