Skip to content

Commit

Permalink
feat: remove tar file after extracted
Browse files Browse the repository at this point in the history
  • Loading branch information
3Shain committed Mar 8, 2023
1 parent 614d0c6 commit c347009
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/wine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
fatal,
getKey,
log,
removeFile,
resolve,
restart,
rmrf_dangerously,
Expand Down Expand Up @@ -93,9 +94,10 @@ export async function createWineInstallProgram({
}) {
async function* program(): CommonUpdateProgram {
yield ["setStateText", "DOWNLOADING_ENVIROMENT"];
const wineTarPath = await resolve("./wine.tar.gz");
for await (const progress of aria2.doStreamingDownload({
uri: wineUpdateTarGzFile,
absDst: await resolve("./wine.tar.gz"),
absDst: wineTarPath,
})) {
yield [
"setProgress",
Expand All @@ -108,8 +110,9 @@ export async function createWineInstallProgram({
const wineBinaryDir = await resolve("./wine");
await rmrf_dangerously(wineBinaryDir);
await unixExec("mkdir", ["-p", wineBinaryDir]);
const p = await tar_extract(await resolve("./wine.tar.gz"), wineBinaryDir);
await log(p.stdOut);
await tar_extract(await resolve("./wine.tar.gz"), wineBinaryDir);
await removeFile(wineTarPath);

yield ["setStateText", "CONFIGURING_ENVIROMENT"];

await xattrRemove("com.apple.quarantine", wineBinaryDir);
Expand Down

0 comments on commit c347009

Please sign in to comment.