From 4939fc8b035de3127c0a97039cd2b1977cffe3cb Mon Sep 17 00:00:00 2001 From: happyZYM Date: Tue, 18 Mar 2025 13:58:20 +0800 Subject: [PATCH] fix: fix uv and bun install on linux (#3514) --- resources/scripts/install-bun.js | 3 ++- resources/scripts/install-uv.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/scripts/install-bun.js b/resources/scripts/install-bun.js index bbe7d5aa..6087c191 100644 --- a/resources/scripts/install-bun.js +++ b/resources/scripts/install-bun.js @@ -110,7 +110,8 @@ async function downloadBunBinary(platform, arch, version = DEFAULT_BUN_VERSION, const sourcePath = path.join(sourceDir, file) const destPath = path.join(binDir, file) - fs.renameSync(sourcePath, destPath) + fs.copyFileSync(sourcePath, destPath) + fs.unlinkSync(sourcePath) // Set executable permissions for non-Windows platforms if (platform !== 'win32') { diff --git a/resources/scripts/install-uv.js b/resources/scripts/install-uv.js index d6378f63..773ff24c 100644 --- a/resources/scripts/install-uv.js +++ b/resources/scripts/install-uv.js @@ -123,7 +123,8 @@ async function downloadUvBinary(platform, arch, version = DEFAULT_UV_VERSION, is for (const file of files) { const sourcePath = path.join(sourceDir, file) const destPath = path.join(binDir, file) - fs.renameSync(sourcePath, destPath) + fs.copyFileSync(sourcePath, destPath) + fs.unlinkSync(sourcePath) // Set executable permissions for non-Windows platforms if (platform !== 'win32') {