Method: Overcommit::Hook::Base#execute

Defined in:
lib/overcommit/hook/base.rb

#execute(cmd, options = {}) ⇒ #status, ...

Execute a command in a separate process.

If splittable_args is specified, ensures that those arguments are concatenated onto the end of the cmd arguments, but split up so that the operating system’s maximum command length is not exceeded. This is useful for splitting up long file lists.

Parameters:

  • cmd (Array<String>)

    command arguments

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :args (Array<String>)

    arguments that can be split up over multiple invocations (usually a list of files)

  • :input (String)

    string to pass to process’ standard input stream

Returns:

  • (#status, #stdout, #stderr)

    struct containing result of invocation



115
116
117
# File 'lib/overcommit/hook/base.rb', line 115

def execute(cmd, options = {})
  Overcommit::Utils.execute(cmd, options)
end