(command: string)
| 101 | } |
| 102 | |
| 103 | const runCommand = async (command: string): Promise<boolean> => { |
| 104 | return new Promise((resolve) => { |
| 105 | const child = spawn(command, { |
| 106 | shell: true, |
| 107 | stdio: 'ignore', |
| 108 | detached: true, |
| 109 | }) |
| 110 | |
| 111 | child.on('error', () => { |
| 112 | resolve(false) |
| 113 | }) |
| 114 | |
| 115 | child.on('close', (code) => { |
| 116 | resolve(code === 0) |
| 117 | }) |
| 118 | |
| 119 | try { |
| 120 | child.unref() |
| 121 | } catch { |
| 122 | // noop |
| 123 | } |
| 124 | }) |
| 125 | } |
| 126 | |
| 127 | export const openFileAtPath = async ( |
| 128 | filePath: string, |
no test coverage detected