MCPcopy Create free account
hub / github.com/SwishHQ/spread / executeCommand

Function executeCommand

cli/bundle_cli.go:202–229  ·  view source on GitHub ↗
(cmd *exec.Cmd)

Source from the content-addressed store, hash-verified

200}
201
202func executeCommand(cmd *exec.Cmd) error {
203 stdout, err := cmd.StdoutPipe()
204 if err != nil {
205 log.Panic("cmd.StdoutPipe() failed with ", err)
206 }
207 stderr, err := cmd.StderrPipe()
208 if err != nil {
209 log.Panic("cmd.StderrPipe() failed with ", err)
210 }
211 if err := cmd.Start(); err != nil {
212 log.Panic("cmd.Start() failed with ", err)
213 }
214
215 go func() {
216 if _, err := io.Copy(os.Stdout, stdout); err != nil {
217 log.Panic("failed to copy stdout: ", err)
218 }
219 }()
220 go func() {
221 if _, err := io.Copy(os.Stderr, stderr); err != nil {
222 log.Panic("failed to copy stderr: ", err)
223 }
224 }()
225 if err := cmd.Wait(); err != nil {
226 log.Panic("cmd.Run() failed with ", err)
227 }
228 return nil
229}
230
231func createBundleCommand(config BundleConfig, buildPath, bundleURL, indexFile, minify string) *exec.Cmd {
232 cmd := exec.Command(

Callers 1

buildBundleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected