Method: ReactNativeUtil::Util#have_command?

Defined in:
lib/react_native_util/util.rb

#have_command?(command) ⇒ Boolean

Determine if a specific command is available.

Parameters:

  • command (#to_s)

    A command to check for

Returns:

  • (Boolean)

    true if found, false otherwise



104
105
106
107
108
# File 'lib/react_native_util/util.rb', line 104

def have_command?(command)
  # May be shell-dependent, OS-dependent
  # Kernel#system does not raise Errno::ENOENT when running under the Bundler
  !`which #{command}`.empty?
end