Skip to content

Commit ad42901

Browse files
committed
remove existing extracted dirs
1 parent 3bfce32 commit ad42901

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/bin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ async function loadStatus(promptIfEmpty) {
8383
// nothing
8484
}
8585
if (status.selectedEngines.length > Object.keys(status.installed).length) {
86-
logger.fatal('Some engines were not installed. This is a bug, please report it.');
86+
logger.fatal('Some engines were not installed.');
8787
process.exitCode = 1;
8888
}
8989
fs.writeFileSync(STATUS_PATH, JSON.stringify(status, null, 2));

src/common.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,15 @@ function guessPlatform() {
5252
return `${platform}${arch}`;
5353
}
5454

55-
function unzip(from, to) {
56-
return extractZip(from, { dir: to });
55+
async function unzip(from, to) {
56+
await rmdir(to);
57+
await extractZip(from, { dir: to });
5758
}
5859

5960
async function untar(from, to) {
61+
await rmdir(to);
6062
await ensureDirectory(to);
61-
return tar.extract({ file: from, cwd: to });
63+
await tar.extract({ file: from, cwd: to });
6264
}
6365

6466
module.exports = {

0 commit comments

Comments
 (0)