(cmd: string, args: ReadonlyArray<string>)
| 95 | ]; |
| 96 | |
| 97 | const sh = (cmd: string, args: ReadonlyArray<string>): Promise<{ ok: boolean; out: string }> => |
| 98 | new Promise((resolve) => { |
| 99 | const child = spawn(cmd, [...args], { stdio: ["ignore", "pipe", "pipe"] }); |
| 100 | let out = ""; |
| 101 | child.stdout?.on("data", (d: Buffer) => (out += d.toString())); |
| 102 | child.stderr?.on("data", (d: Buffer) => (out += d.toString())); |
| 103 | child.on("error", () => resolve({ ok: false, out })); |
| 104 | child.on("exit", (code) => resolve({ ok: code === 0, out })); |
| 105 | }); |
| 106 | |
| 107 | const findTailscale = async (): Promise<string | undefined> => { |
| 108 | for (const candidate of TAILSCALE_CANDIDATES) { |
no test coverage detected