(rack sdk.Interface, c *stdcli.Context)
| 19 | } |
| 20 | |
| 21 | func Exec(rack sdk.Interface, c *stdcli.Context) error { |
| 22 | pid := c.Arg(0) |
| 23 | command := strings.Join(c.Args[1:], " ") |
| 24 | |
| 25 | opts := structs.ProcessExecOptions{} |
| 26 | |
| 27 | if w, h, err := c.TerminalSize(); err == nil { |
| 28 | opts.Height = options.Int(h) |
| 29 | opts.Width = options.Int(w) |
| 30 | } |
| 31 | |
| 32 | if !stdcli.IsTerminal(os.Stdin) { |
| 33 | opts.Tty = options.Bool(false) |
| 34 | } |
| 35 | |
| 36 | restore := c.TerminalRaw() |
| 37 | defer restore() |
| 38 | |
| 39 | code, err := rack.ProcessExec(app(c), pid, command, c, opts) |
| 40 | if err != nil { |
| 41 | return err |
| 42 | } |
| 43 | |
| 44 | return stdcli.Exit(code) |
| 45 | } |
nothing calls this directly
no test coverage detected