(e *procfileEntry, shell string, setPort bool)
| 164 | } |
| 165 | |
| 166 | func (c *command) createScriptFile(e *procfileEntry, shell string, setPort bool) string { |
| 167 | scriptFile, err := os.Create(filepath.Join(c.scriptDir, e.Name)) |
| 168 | utils.FatalOnErr(err) |
| 169 | |
| 170 | fmt.Fprintf(scriptFile, "#!/usr/bin/env %s\n", shell) |
| 171 | if setPort { |
| 172 | fmt.Fprintf(scriptFile, "export PORT=%d\n", e.Port) |
| 173 | } |
| 174 | fmt.Fprintf(scriptFile, "export PS=%s\n", e.Name) |
| 175 | fmt.Fprintln(scriptFile, e.Command) |
| 176 | |
| 177 | utils.FatalOnErr(scriptFile.Chmod(0744)) |
| 178 | |
| 179 | utils.FatalOnErr(scriptFile.Close()) |
| 180 | |
| 181 | return scriptFile.Name() |
| 182 | } |
| 183 | |
| 184 | func (c *command) checkTmux() bool { |
| 185 | return utils.RunCmd("tmux", "-V") == nil |
no test coverage detected