MCPcopy Index your code
hub / github.com/GoEdgeLab/EdgeNode / compose

Method compose

internal/utils/exec/cmd.go:133–162  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

131}
132
133func (this *Cmd) compose() *exec.Cmd {
134 if this.rawCmd != nil {
135 return this.rawCmd
136 }
137
138 if this.ctx != nil {
139 this.rawCmd = exec.CommandContext(this.ctx, this.name, this.args...)
140 } else {
141 this.rawCmd = exec.Command(this.name, this.args...)
142 }
143
144 if this.env != nil {
145 this.rawCmd.Env = this.env
146 }
147
148 if len(this.dir) > 0 {
149 this.rawCmd.Dir = this.dir
150 }
151
152 if this.captureStdout {
153 this.stdout = &bytes.Buffer{}
154 this.rawCmd.Stdout = this.stdout
155 }
156 if this.captureStderr {
157 this.stderr = &bytes.Buffer{}
158 this.rawCmd.Stderr = this.stderr
159 }
160
161 return this.rawCmd
162}

Callers 3

StartMethod · 0.95
WaitMethod · 0.95
RunMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected