lib/open_project/gitolite/utils/exec.rb
# Executes the given command and a list of parameters on the shell
# and returns the result.
#
# If the operation throws an exception or the operation yields a non-zero exit code
# we rethrow a +GitoliteCommandException+ with a meaningful error message.
Executes the given command and a list of parameters on the shell
and returns the result.

If the operation throws an exception or the operation yields a non-zero exit code
we rethrow a +GitoliteCommandException+ with a meaningful error message.
Executes the given command and a list of parameters on the shell and returns the result . If the operation throws an exception or the operation yields a non - zero exit code we rethrow a + GitoliteCommandException + with a meaningful error message .
def capture(command, args = [], opts = {}, &block)
        merge_output = opts.delete(:merge_output) { false }
        stdout, stderr, code = execute(command, args, opts, &block)
        if code != 0
          error_msg = "Non-zero exit code #{code} for `#{command} #{args.join(" ")}`"
          OpenProject::Gitolite.logger.debug(error_msg)
          raise OpenProject::Gitolite::Error::GitoliteCommandException.new(command, error_msg)
        end
        merge_output ? stdout + stderr : stdout
      end
def capture ( command , args = [ ] , opts = { } , & block ) merge_output = opts . delete ( :merge_output ) { false } stdout , stderr , code = execute ( command , args , opts , & block ) if code != 0 error_msg = "Non-zero exit code #{code} for `#{command} #{args.join(" ")}`" OpenProject :: Gitolite . logger . debug ( error_msg ) raise OpenProject :: Gitolite :: Error :: GitoliteCommandException . new ( command , error_msg ) end merge_output ? stdout + stderr : stdout end
Executes the given command and a list of parameters on the shell
and returns the result.
Executes the given command and a list of parameters on the shell and returns the result .
command
args
opts
block