(url, dest)
| 64 | } |
| 65 | |
| 66 | function tryPowerShellDownload(url, dest) { |
| 67 | const u = url.replace(/'/g, "''") |
| 68 | const d = dest.replace(/'/g, "''") |
| 69 | const cmd = `Invoke-WebRequest -Uri '${u}' -OutFile '${d}' -UseBasicParsing` |
| 70 | const result = spawnSync('powershell.exe', ['-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Bypass', '-Command', cmd], { stdio: 'pipe', windowsHide: true }) |
| 71 | return result.status === 0 && existsSync(dest) && statSync(dest).size > 0 |
| 72 | } |
| 73 | |
| 74 | function tryCurlDownload(url, dest) { |
| 75 | const curl = process.platform === 'win32' ? 'curl.exe' : 'curl' |
no test coverage detected