MCPcopy
hub / github.com/larksuite/cli / download

Function download

scripts/install.js:160–176  ·  view source on GitHub ↗
(url, destPath)

Source from the content-addressed store, hash-verified

158}
159
160function 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
178function extractZipWindows(archivePath, destDir) {
179 const psOpts = ["-NoProfile", "-ExecutionPolicy", "Bypass", "-Command"];

Callers 2

installFunction · 0.85
EnrichResourceDownloadsFunction · 0.85

Calls 2

assertAllowedHostFunction · 0.85

Tested by

no test coverage detected