Skip to content

Commit 77d5347

Browse files
committed
wip
1 parent f7a0a83 commit 77d5347

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

brewkit/unarchive.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,18 @@ export default async function (
1818
if (!rsp.ok) {
1919
throw new Error("failed to connect to host");
2020
}
21-
if (!Deno.env.get("CI")) {
22-
using file = await Deno.open(predownloaded_file.string, { write: true, create: true });
23-
const [body1, body2] = rsp.body!.tee();
24-
await body1.pipeTo(file.writable);
25-
return body2;
26-
} else {
27-
return rsp.body!;
28-
}
21+
using file = await Deno.open(predownloaded_file.string, { write: true, create: true });
22+
const [body1, body2] = rsp.body!.tee();
23+
await body1.pipeTo(file.writable);
24+
return body2;
2925
} else {
3026
console.error(
3127
"%cℹ︎",
3228
"color:blue",
3329
"using pre-download:",
3430
predownloaded_file.relative({ to: root }),
3531
);
36-
const file = await Deno.open(predownloaded_file.string, { read: true });
32+
const file = await Deno.open(predownloaded_file.string);
3733
return file.readable;
3834
}
3935
})();
@@ -59,8 +55,9 @@ export default async function (
5955
throw new Error("unarchive failed");
6056
}
6157
} else {
58+
await input.getReader().read(); //FIXME inefficient for predownloaded case
6259
const unzip = await new Deno.Command("unzip", {
63-
args: ["-"],
60+
args: [predownloaded_file.string],
6461
stdin: "piped",
6562
}).spawn();
6663
const [_, { success }] = await Promise.all([

0 commit comments

Comments
 (0)