Comparing version 1.210.0 to 1.210.1
{ | ||
"name": "supabase", | ||
"version": "1.210.0", | ||
"version": "1.210.1", | ||
"description": "Supabase CLI", | ||
@@ -5,0 +5,0 @@ "repository": "supabase/cli", |
@@ -101,2 +101,3 @@ #!/usr/bin/env node | ||
// Read from package.json and prepare for the installation. | ||
const pkg = await readPackageJson(); | ||
@@ -108,2 +109,3 @@ if (platform === "windows") { | ||
// Prepare the installation path by creating the directory if it doesn't exist. | ||
const binPath = pkg.bin[pkg.name]; | ||
@@ -113,9 +115,3 @@ const binDir = path.dirname(binPath); | ||
// First we will Un-GZip, then we will untar. | ||
const ungz = zlib.createGunzip(); | ||
const binName = path.basename(binPath); | ||
const untar = extract({ cwd: binDir }, [binName]); | ||
const url = getDownloadUrl(pkg); | ||
console.info("Downloading", url); | ||
// Create the agent that will be used for all the fetch requests later. | ||
const proxyUrl = | ||
@@ -125,3 +121,2 @@ process.env.npm_config_https_proxy || | ||
process.env.npm_config_proxy; | ||
// Keeps the TCP connection alive when sending multiple requests | ||
@@ -132,8 +127,19 @@ // Ref: https://github.com/node-fetch/node-fetch/issues/1735 | ||
: new Agent({ keepAlive: true }); | ||
// First, fetch the checksum map. | ||
const checksumMap = await fetchAndParseCheckSumFile(pkg, agent); | ||
// Then, download the binary. | ||
const url = getDownloadUrl(pkg); | ||
console.info("Downloading", url); | ||
const resp = await fetch(url, { agent }); | ||
const hash = createHash("sha256"); | ||
const pkgNameWithPlatform = `${pkg.name}_${platform}_${arch}.tar.gz`; | ||
const checksumMap = await fetchAndParseCheckSumFile(pkg, agent); | ||
// Then, decompress the binary -- we will first Un-GZip, then we will untar. | ||
const ungz = zlib.createGunzip(); | ||
const binName = path.basename(binPath); | ||
const untar = extract({ cwd: binDir }, [binName]); | ||
// Update the hash with the binary data as it's being downloaded. | ||
resp.body | ||
@@ -143,4 +149,6 @@ .on("data", (chunk) => { | ||
}) | ||
// Pipe the data to the ungz stream. | ||
.pipe(ungz); | ||
// After the ungz stream has ended, verify the checksum. | ||
ungz | ||
@@ -160,4 +168,6 @@ .on("end", () => { | ||
}) | ||
// Pipe the data to the untar stream. | ||
.pipe(untar); | ||
// Wait for the untar stream to finish. | ||
await new Promise((resolve, reject) => { | ||
@@ -164,0 +174,0 @@ untar.on("error", reject); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12512
155