[feat] Download bun+uv on make dev-tauri (#4981)

* only download if not exist

* add download:bin to dev-tauri
This commit is contained in:
Thien Tran 2025-05-13 09:47:54 +07:00 committed by Louis
parent 52ac14ad06
commit 6ed5d44258
No known key found for this signature in database
GPG Key ID: 44FA9F4D33C37DE2
2 changed files with 11 additions and 7 deletions

View File

@ -41,6 +41,7 @@ dev: check-file-counts
dev-tauri: check-file-counts
yarn install:cortex
yarn download:bin
yarn dev:tauri
# Linting

View File

@ -110,8 +110,11 @@ async function main() {
}
console.log(`Downloading Bun for ${bunPlatform}...`)
await download(bunUrl, path.join(tempBinDir, `bun-${bunPlatform}.zip`))
await decompress(bunPath, tempBinDir)
const bunSaveDir = path.join(tempBinDir, `bun-${bunPlatform}.zip`)
if (!fs.existsSync(bunSaveDir)) {
await download(bunUrl, bunSaveDir)
await decompress(bunPath, tempBinDir)
}
try {
copySync(
path.join(tempBinDir, `bun-${bunPlatform}`, 'bun'),
@ -156,12 +159,12 @@ async function main() {
console.log('Bun downloaded.')
console.log(`Downloading UV for ${uvPlatform}...`)
if (platform === 'win32') {
await download(uvUrl, path.join(tempBinDir, `uv-${uvPlatform}.zip`))
} else {
await download(uvUrl, path.join(tempBinDir, `uv-${uvPlatform}.tar.gz`))
const uvExt = platform === 'win32' ? `zip` : `tar.gz`
const uvSaveDir = path.join(tempBinDir, `uv-${uvPlatform}.${uvExt}`)
if (!fs.existsSync(uvSaveDir)) {
await download(uvUrl, uvSaveDir)
await decompress(uvPath, tempBinDir)
}
await decompress(uvPath, tempBinDir)
try {
copySync(
path.join(tempBinDir, `uv-${uvPlatform}`, 'uv'),