summaryrefslogtreecommitdiff
path: root/tools/util.js
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-06-05 11:04:16 -0400
committerGitHub <noreply@github.com>2024-06-05 17:04:16 +0200
commit7ed90a20d04982ae15a52ae2378cbffd4b6839df (patch)
tree3297d6f7227fbf1cf80e17a2a376ef4dfa52e6ad /tools/util.js
parent0544d60012006b1c7799d8b6eafacec9567901ad (diff)
fix: better handling of npm resolution occurring on workers (#24094)
Closes https://github.com/denoland/deno/issues/24063
Diffstat (limited to 'tools/util.js')
-rw-r--r--tools/util.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/util.js b/tools/util.js
index 75ee1b527..1497a2887 100644
--- a/tools/util.js
+++ b/tools/util.js
@@ -227,6 +227,12 @@ export async function downloadPrebuilt(toolName) {
);
}
spinner.text = `Successfully downloaded: ${toolName}`;
+ try {
+ // necessary on Windows it seems
+ await Deno.remove(toolPath);
+ } catch {
+ // ignore
+ }
await Deno.rename(tempFile, toolPath);
} catch (e) {
spinner.fail();