()
| 68 | } |
| 69 | |
| 70 | async function readClipboardViaPbpaste(): Promise<string> { |
| 71 | const { stdout, code } = await execFileNoThrow('pbpaste', [], { |
| 72 | useCwd: false, |
| 73 | }) |
| 74 | if (code !== 0) { |
| 75 | throw new Error(`pbpaste exited with code ${code}`) |
| 76 | } |
| 77 | return stdout |
| 78 | } |
| 79 | |
| 80 | async function writeClipboardViaPbcopy(text: string): Promise<void> { |
| 81 | const { code } = await execFileNoThrow('pbcopy', [], { |
no test coverage detected