(text: string)
| 154 | } |
| 155 | |
| 156 | function tryCopyViaPlatformTool(text: string): boolean { |
| 157 | const { execSync } = require('child_process') as typeof import('child_process') |
| 158 | const opts = { input: text, stdio: ['pipe', 'ignore', 'ignore'] as ('pipe' | 'ignore')[] } |
| 159 | |
| 160 | try { |
| 161 | if (process.platform === 'darwin') { |
| 162 | execSync('pbcopy', opts) |
| 163 | } else if (process.platform === 'linux') { |
| 164 | try { |
| 165 | execSync('xclip -selection clipboard', opts) |
| 166 | } catch { |
| 167 | execSync('xsel --clipboard --input', opts) |
| 168 | } |
| 169 | } else if (process.platform === 'win32') { |
| 170 | execSync('clip', opts) |
| 171 | } else { |
| 172 | return false |
| 173 | } |
| 174 | return true |
| 175 | } catch { |
| 176 | return false |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | function tryCopyViaRenderer(text: string): boolean { |
| 181 | if (!registeredRenderer) return false |
no outgoing calls
no test coverage detected