MCPcopy Index your code
hub / github.com/DarthSim/overmind / Run

Method Run

start/command.go:112–160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110}
111
112func (c *command) Run() (int, error) {
113 defer os.RemoveAll(c.scriptDir)
114 defer c.output.Stop()
115
116 fmt.Printf("\033]0;%s | overmind\007", c.title)
117
118 if !c.checkTmux() {
119 return 1, errors.New("Can't find tmux. Did you forget to install it?")
120 }
121
122 c.output.WriteBoldLinef(nil, "Tmux socket name: %v", c.tmux.Socket)
123 c.output.WriteBoldLinef(nil, "Tmux session ID: %v", c.tmux.Session)
124 c.output.WriteBoldLinef(nil, "Listening at %v", c.cmdCenter.SocketPath)
125
126 c.startCommandCenter()
127 defer c.stopCommandCenter()
128
129 if c.daemonize {
130 if !daemon.WasReborn() {
131 c.stopCommandCenter()
132 }
133
134 ctx := new(daemon.Context)
135 child, err := ctx.Reborn()
136
137 if child != nil {
138 c.output.WriteBoldLinef(nil, "Daemonized. Use `overmind echo` to view logs and `overmind quit` to gracefully quit daemonized instance")
139 return 0, err
140 }
141
142 defer ctx.Release()
143 }
144
145 c.runProcesses()
146
147 go c.waitForExit()
148
149 go c.handleInfo()
150
151 c.doneWg.Wait()
152
153 exitCode := c.tmux.ExitCode()
154
155 time.Sleep(time.Second)
156
157 c.tmux.Shutdown()
158
159 return exitCode, nil
160}
161
162func (c *command) Quit() {
163 c.stopTrig <- syscall.SIGINT

Callers

nothing calls this directly

Calls 11

checkTmuxMethod · 0.95
startCommandCenterMethod · 0.95
stopCommandCenterMethod · 0.95
runProcessesMethod · 0.95
waitForExitMethod · 0.95
handleInfoMethod · 0.95
WriteBoldLinefMethod · 0.80
WaitMethod · 0.80
ExitCodeMethod · 0.80
ShutdownMethod · 0.80
StopMethod · 0.45

Tested by

no test coverage detected