()
| 149 | } |
| 150 | |
| 151 | function detectPackageManager(): PackageManagerInfo | null { |
| 152 | if (process.platform === 'darwin') { |
| 153 | if (hasCommand('brew')) { |
| 154 | return { |
| 155 | cmd: 'brew', |
| 156 | args: ['install', 'sox'], |
| 157 | displayCommand: 'brew install sox', |
| 158 | } |
| 159 | } |
| 160 | return null |
| 161 | } |
| 162 | |
| 163 | if (process.platform === 'linux') { |
| 164 | if (hasCommand('apt-get')) { |
| 165 | return { |
| 166 | cmd: 'sudo', |
| 167 | args: ['apt-get', 'install', '-y', 'sox'], |
| 168 | displayCommand: 'sudo apt-get install sox', |
| 169 | } |
| 170 | } |
| 171 | if (hasCommand('dnf')) { |
| 172 | return { |
| 173 | cmd: 'sudo', |
| 174 | args: ['dnf', 'install', '-y', 'sox'], |
| 175 | displayCommand: 'sudo dnf install sox', |
| 176 | } |
| 177 | } |
| 178 | if (hasCommand('pacman')) { |
| 179 | return { |
| 180 | cmd: 'sudo', |
| 181 | args: ['pacman', '-S', '--noconfirm', 'sox'], |
| 182 | displayCommand: 'sudo pacman -S sox', |
| 183 | } |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | return null |
| 188 | } |
| 189 | |
| 190 | export async function checkVoiceDependencies(): Promise<{ |
| 191 | available: boolean |
no test coverage detected