Skip to content

Commit

Permalink
feat(*): delete archieve after uncompressing
Browse files Browse the repository at this point in the history
  • Loading branch information
stepancar authored and ayushmanchhabra committed Mar 11, 2024
1 parent d24e926 commit 0e916a4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,11 @@ async function install() {
exit(1);
}
}

let binaryNeedsToBeRemoved = false;

if (existsSync(nwCache) === false) {
binaryNeedsToBeRemoved = true;
const bar = new progress.SingleBar({}, progress.Presets.rect);

const stream = createWriteStream(nwCache);
Expand Down Expand Up @@ -217,6 +220,11 @@ async function install() {
});
await compressing[platform === 'linux' ? 'tgz' : 'zip']
.uncompress(nwCache, '.');

if (binaryNeedsToBeRemoved) {
await rm(nwCache, { force: true });
}

await rename(
nwFile,
nwDir
Expand Down

0 comments on commit 0e916a4

Please sign in to comment.