MCPcopy Create free account
hub / github.com/coder/envbuilder / waitForCommand

Function waitForCommand

devcontainer/script.go:127–140  ·  view source on GitHub ↗
(desc string, pid int)

Source from the content-addressed store, hash-verified

125}
126
127func waitForCommand(desc string, pid int) error {
128 process, err := os.FindProcess(pid)
129 if err != nil {
130 return fmt.Errorf("failed to look up process for lifecycle command %q: %v", desc, err)
131 }
132 status, err := process.Wait()
133 if err != nil {
134 return fmt.Errorf("failed to wait for lifecycle command %q: %v", desc, err)
135 }
136 if exitCode := status.ExitCode(); exitCode != 0 {
137 return fmt.Errorf("lifecycle command %q failed with status %d", desc, exitCode)
138 }
139 return nil
140}
141
142// ScriptLines returns shell syntax for executing the commands in the
143// LifecycleScript.

Callers 1

ExecuteMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected