MCPcopy Create free account
hub / github.com/diillson/chatcli / runCommandCtx

Function runCommandCtx

pkg/coder/engine/commands_exec.go:219–229  ·  view source on GitHub ↗
(ctx context.Context, dir, cmd string, args ...string)

Source from the content-addressed store, hash-verified

217}
218
219func runCommandCtx(ctx context.Context, dir, cmd string, args ...string) (string, error) {
220 ctx, cancel := context.WithTimeout(ctx, 5*time.Minute)
221 defer cancel()
222
223 command := exec.CommandContext(ctx, cmd, args...) //#nosec G204 -- agent/CLI tool execution; commands validated by command_validator + policy_manager upstream
224 if dir != "" {
225 command.Dir = dir
226 }
227 out, err := command.CombinedOutput()
228 return string(out), err
229}
230
231func runCommandWithContext(ctx context.Context, dir, cmdLine string) (string, error) {
232 shell, shellFlag := resolveShell()

Callers 6

runRipgrepMethod · 0.85
handleGitStatusMethod · 0.85
handleGitDiffMethod · 0.85
handleGitLogMethod · 0.85
handleGitChangedMethod · 0.85
handleGitBranchMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected