(url, destPath)
| 158 | } |
| 159 | |
| 160 | function download(url, destPath) { |
| 161 | assertAllowedHost(url); |
| 162 | const args = [ |
| 163 | "--fail", "--location", "--silent", "--show-error", |
| 164 | "--connect-timeout", "10", "--max-time", "120", |
| 165 | "--max-redirs", "3", |
| 166 | "--output", destPath, |
| 167 | ]; |
| 168 | // --ssl-revoke-best-effort: on Windows (Schannel), avoid CRYPT_E_REVOCATION_OFFLINE |
| 169 | // errors when the certificate revocation list server is unreachable. |
| 170 | // Only use it when the system curl is new enough (>= 7.70.0). |
| 171 | if (isWindows && curlSupportsSslRevokeBestEffort()) { |
| 172 | args.unshift("--ssl-revoke-best-effort"); |
| 173 | } |
| 174 | args.push(url); |
| 175 | execFileSync("curl", args, { stdio: ["ignore", "ignore", "pipe"] }); |
| 176 | } |
| 177 | |
| 178 | function extractZipWindows(archivePath, destDir) { |
| 179 | const psOpts = ["-NoProfile", "-ExecutionPolicy", "Bypass", "-Command"]; |
no test coverage detected