MCPcopy Create free account
hub / github.com/cortesi/modd / Run

Method Run

shell/shell.go:127–148  ·  view source on GitHub ↗
(log termlog.Stream, bufferr bool)

Source from the content-addressed store, hash-verified

125}
126
127func (e *Executor) Run(log termlog.Stream, bufferr bool) (error, *ExecState) {
128 if e.cmd != nil {
129 return fmt.Errorf("already running"), nil
130 }
131 cmd, buff, wg, err := e.start(log, bufferr)
132 if err != nil {
133 return err, nil
134 }
135
136 // Order is important here. We MUST wait for the readers to exit before we wait
137 // on the command itself.
138 wg.Wait()
139
140 eret := cmd.Wait()
141 estate := &ExecState{
142 Error: eret,
143 ErrOutput: buff.String(),
144 ProcState: cmd.ProcessState.String(),
145 }
146 e.reset()
147 return nil, estate
148}
149
150func (e *Executor) Signal(sig os.Signal) error {
151 e.Lock()

Callers 4

RunProcFunction · 0.95
testCmdFunction · 0.95
sendSignalMethod · 0.45
TestShellsFunction · 0.45

Calls 3

startMethod · 0.95
resetMethod · 0.95
StringMethod · 0.45

Tested by 2

testCmdFunction · 0.76
TestShellsFunction · 0.36