| 1 | package workbench |
| 2 | |
| 3 | import ( |
| 4 | "context" |
| 5 | "os/exec" |
| 6 | |
| 7 | "al.essio.dev/pkg/shellescape" |
| 8 | ) |
| 9 | |
| 10 | func (s *Server) macOSPhoneBrowserClient(parent context.Context) *windowsBrowserClient { |
| 11 | ctx, cancel := context.WithCancel(parent) |
| 12 | return &windowsBrowserClient{ctx: ctx, cancel: cancel, start: func(ctx context.Context) (*exec.Cmd, error) { |
| 13 | const base = "/usr/local/libexec/cage-workbench-browser-4.145.0-pw1.65.0/" |
| 14 | configuration, err := loadConfig(s.configPath) |
| 15 | if err != nil { |
| 16 | return nil, err |
| 17 | } |
| 18 | command := "exec " + shellescape.QuoteCommand([]string{"env", "LANG=" + configuration.Locale, "LC_ALL=" + configuration.Locale, base + "editor/lib/node", base + "controller/macos-phone-browser.mjs"}) |
| 19 | return s.macOSSSHCommand(ctx, "-T", s.sshTarget(), "--", command), nil |
| 20 | }} |
| 21 | } |