MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / ExecCommandWithOptionalSudo

Function ExecCommandWithOptionalSudo

agent/utils/cmd/cmd.go:49–52  ·  view source on GitHub ↗
(name string, args ...string)

Source from the content-addressed store, hash-verified

47}
48
49func ExecCommandWithOptionalSudo(name string, args ...string) *exec.Cmd {
50 commandName, commandArgs := WrapWithOptionalSudo(name, args...)
51 return exec.Command(commandName, commandArgs...)
52}
53
54func WriteFileWithOptionalSudo(name string, data []byte, perm os.FileMode) error {
55 if err := os.WriteFile(name, data, perm); err == nil {

Callers

nothing calls this directly

Calls 1

WrapWithOptionalSudoFunction · 0.85

Tested by

no test coverage detected