MCPcopy Index your code
hub / github.com/codeaashu/claude-code / detectPackageManager

Function detectPackageManager

src/services/voice.ts:151–188  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

149}
150
151function 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
190export async function checkVoiceDependencies(): Promise<{
191 available: boolean

Callers 2

checkVoiceDependenciesFunction · 0.85

Calls 1

hasCommandFunction · 0.70

Tested by

no test coverage detected