Executes the given git command

 @param [String] git_cmd the CLI command to execute
 @yield the block to run in the context of running the command. See {IO#popen}

 @return [String] the output of the git command
171260
def run_command(git_cmd, &block)
      if block_given?
        return IO.popen(git_cmd, &block)
      else
        return `#{git_cmd}`.chomp
      end
    end
943333
def execute_command(self, cmd, params=None, callback=None, raw=False):
        '''
        
        '''
        def execute_with_callbacks(cmd, params=None, callback=None, raw=False):
            code, params = self.send_command(cmd, params, raw)
            if callback:
                callback(code, params)
            return code, params

        if self.daemon:
            t = Thread(target=execute_with_callbacks,
                    args=(cmd, ), kwargs={'params':params, 'callback':callback, 'raw':raw})
            t.daemon = True
            t.start()
        else:
            return execute_with_callbacks(cmd, params, callback, raw)
7439
def git_pull(repo_dir, remote="origin", ref=None, update_head_ok=False):
    """"""
    command = ['git', 'pull']
    if update_head_ok:
        command.append('--update-head-ok')
    command.append(pipes.quote(remote))
    if ref:
        command.append(ref)
    return execute_git_command(command, repo_dir=repo_dir)
835227
def exec_cmd(self, cmd):
        '''
        
        '''
        cmd = self._cmd_str(cmd)

        logmsg = 'Executing command: {0}'.format(cmd)
        if self.passwd:
            logmsg = logmsg.replace(self.passwd, ('*' * 6))
        if 'decode("base64")' in logmsg or 'base64.b64decode(' in logmsg:
            log.debug('Executed SHIM command. Command logged to TRACE')
            log.trace(logmsg)
        else:
            log.debug(logmsg)

        ret = self._run_cmd(cmd)
        return ret
1319516
def output_command(command_string)
      $stdout.puts
      $stdout.puts StringMasker.new(command_string, :username => username, :password => password).to_s
    end
1367306
def _run_cli_process(cmd, shell=True):
        
        from subprocess import Popen, PIPE

        p = Popen(cmd, shell=shell, stdout=PIPE, stderr=PIPE)
        _stdout, _stderr = p.communicate()
        return _stdout, _stderr, p.returncode
1344541
def execute_command(self, cmnd, *args, **options):
        ""
        args, options = self.preprocess_command(cmnd, *args, **options)
        return self.client.execute_command(cmnd, *args, **options)
262075
def execute(self, cmd, cwd):
        
        self.output = ""
        env = os.environ.copy()
        env.update(self.env)
        if six.PY2:  # nocv
            # Ugly hack because python 2.7.
            if self._stdout == self.DEVNULL:
                self._stdout = open(os.devnull, 'w+b')
            if self._stderr == self.DEVNULL:
                self._stderr = open(os.devnull, 'w+b')
        proc = subprocess.Popen(
            cmd, stdout=self._stdout, stderr=self._stderr,
            bufsize=0, universal_newlines=True,
            cwd=cwd, env=env,
            close_fds=ON_POSIX
        )
        for line in self._unbuffered(proc):
            self.line_handler(line)
        return_code = proc.poll()
        if return_code:
            logger.error(self.output)
            raise subprocess.CalledProcessError(
                return_code, cmd, output=str(self.output)
            )
        return self.output
576593
def runCommand(cmd, timeout=None, window=None):
    
    p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
    output = ''
    for line in p.stdout:
        line = line.decode(errors='replace' if (sys.version_info) < (3, 5) else 'backslashreplace').rstrip()
        output += line
        print(line)
        window.Refresh() if window else None        # yes, a 1-line if, so shoot me

    retval = p.wait(timeout)
    return (retval, output)
54905
def command(commands)
      command = Command.new(commands)
      server.remote_expr("VimrunnerEvaluateCommandOutput('#{command}')").tap do |output|
        raise InvalidCommandError.new(output) if output =~ /^Vim(\(call\))?:E\d+:/
      end
    end
339401
function execute(cmd) {
  var result = promise.defer();
  exec(cmd, function(err, stdout) {
    if (err) {
      result.reject(err);
    } else {
      result.fulfill(stdout);
    }
  });
  return result.promise;
}
411915
def runCmd(cls, cmd):
        
        cit.echo(cmd, "command")
        result = os.system(cmd)
        cls.checkResult(result)
1020090
def execute
      subcmd_name = @match[1]
      return puts(help) unless subcmd_name

      subcmd = subcommand_list.match(subcmd_name)
      raise CommandNotFound.new(subcmd_name, self.class) unless subcmd

      subcmd.new(processor, arguments).execute
    end
993173
function run(cmd) {
        return function (callback, options) {
            grunt.verbose.or.ok("Executing " + cmd);
            exec(cmd, options || {}, function (error, stdout, stderr) {
                if (error) {
                    grunt.fatal("'" + cmd + "' failed with :" + stderr);
                } else {
                    grunt.verbose.writeln("Result of " + cmd + ':\n' + stdout);
                    callback();
                }
            });
        };
    }
1145958
def run_cmd(input)
      safely do
        command = command_list.match(input)
        return command.new(self, input).execute if command

        puts safe_inspect(multiple_thread_eval(input))
      end
    end
107175
private function Run_Cmd($_cmd, $_args = '')
    {
        if ( $_args != '' )
        {
            if ( $_cmd == '' ) $_cmd = $_args;
            else $_cmd = $_cmd." ".$_args;
            //$_cmd == ''?$_cmd = $_args:$_cmd." ".$_args;
        }

        fputs($this->Smtp_Socket, $_cmd."\r\n");
        return $this->Smtp_Ok();  //return the response code
    }
1096594
def cmd(send, msg, args):
    
    parser = arguments.ArgParser(args['config'])
    parser.add_argument('action', choices=['check', 'master', 'commit'], nargs='?')

    try:
        cmdargs = parser.parse_args(msg)
    except arguments.ArgumentException as e:
        send(str(e))
        return
    api_output = get('https://api.github.com/repos/%s/branches/master' % args['config']['api']['githubrepo']).json()
    commit, version = misc.get_version(args['handler'].confdir)
    if not cmdargs.action:
        send(version)
        return
    if cmdargs.action == 'master':
        send(api_output['commit']['sha'])
    elif cmdargs.action == 'check':
        if commit is None:
            send("Not running from git, version %s" % version)
        else:
            check = 'Same' if api_output['commit']['sha'] == commit else 'Different'
            send(check)
    elif cmdargs.action == 'commit':
        if commit is None:
            send("Not running from git, version %s" % version)
        else:
            send(commit)