(scriptUrl: string, os: 'windows' | 'linux')
| 398 | * SHARED between install and uninstall generators (IDENTICAL logic) |
| 399 | */ |
| 400 | export function buildScriptCommand(scriptUrl: string, os: 'windows' | 'linux'): string { |
| 401 | if (os === 'windows') { |
| 402 | // Windows PowerShell command |
| 403 | if (scriptUrl.endsWith('.exe')) { |
| 404 | // Direct download and run executable |
| 405 | return `irm ${scriptUrl} -OutFile installer.exe; .\\installer.exe`; |
| 406 | } else { |
| 407 | // Run script directly |
| 408 | return `irm ${scriptUrl} | iex`; |
| 409 | } |
| 410 | } else { |
| 411 | // Linux curl command |
| 412 | return `curl -fsSL ${scriptUrl} | bash`; |
| 413 | } |
| 414 | } |
no outgoing calls
no test coverage detected