Skip to content

Commit

Permalink
do not rely on unzip
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushmanchhabra committed Oct 3, 2023
1 parent d95db9d commit 4f6f934
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions src/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ async function get_nwjs({
log.debug(`Response from ${url}`);
let chunks = 0;
bar.start(Number(response.headers["content-length"]), 0);
response.on("data", async (chunk) => {
response.on("data", (chunk) => {
chunks += chunk.length;
bar.increment();
bar.update(chunks);
Expand All @@ -197,22 +197,6 @@ async function get_nwjs({
bar.stop();
if (platform === "linux") {
compressing.tgz.uncompress(out, cacheDir).then(() => resolve());
} else if (platform === "osx") {
//TODO: compressing package does not restore symlinks on some macOS (eg: circleCI)
const exec = function (cmd) {
log.debug(cmd);
const result = spawnSync(cmd, {
shell: true,
stdio: "inherit",
});
if (result.status !== 0) {
log.debug(`Command failed with status ${result.status}`);
if (result.error) console.log(result.error);
EXIT(1);
}
return resolve();
};
exec(`unzip -o "${out}" -d "${cacheDir}"`);
} else {
compressing.zip.uncompress(out, cacheDir).then(() => resolve());
}
Expand Down Expand Up @@ -329,7 +313,7 @@ async function get_ffmpeg({
log.debug(`Response from ${url}`);
let chunks = 0;
bar.start(Number(response.headers["content-length"]), 0);
response.on("data", async (chunk) => {
response.on("data", (chunk) => {
chunks += chunk.length;
bar.increment();
bar.update(chunks);
Expand Down

0 comments on commit 4f6f934

Please sign in to comment.