Method: ReactNativeUtil::Util#execute
- Defined in:
- lib/react_native_util/util.rb
#execute(*command, chdir: nil, output: STDOUT, log: STDOUT) ⇒ Object
Execute the specified command. If output is non-nil, generate a log at that location. Main log (open) is log.
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/react_native_util/util.rb', line 43 def execute(*command, chdir: nil, output: STDOUT, log: STDOUT) log.log_command command unless log.nil? = chdir.nil? ? {} : { chdir: chdir } system(*command, .merge(%i[err out] => output)) raise ExecutionError, "#{command.shelljoin}: #{$?}" unless $?.success? nil end |