[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:
parent
52ac14ad06
commit
6ed5d44258
1
Makefile
1
Makefile
@ -41,6 +41,7 @@ dev: check-file-counts
|
|||||||
|
|
||||||
dev-tauri: check-file-counts
|
dev-tauri: check-file-counts
|
||||||
yarn install:cortex
|
yarn install:cortex
|
||||||
|
yarn download:bin
|
||||||
yarn dev:tauri
|
yarn dev:tauri
|
||||||
|
|
||||||
# Linting
|
# Linting
|
||||||
|
|||||||
@ -110,8 +110,11 @@ async function main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
console.log(`Downloading Bun for ${bunPlatform}...`)
|
console.log(`Downloading Bun for ${bunPlatform}...`)
|
||||||
await download(bunUrl, path.join(tempBinDir, `bun-${bunPlatform}.zip`))
|
const bunSaveDir = path.join(tempBinDir, `bun-${bunPlatform}.zip`)
|
||||||
|
if (!fs.existsSync(bunSaveDir)) {
|
||||||
|
await download(bunUrl, bunSaveDir)
|
||||||
await decompress(bunPath, tempBinDir)
|
await decompress(bunPath, tempBinDir)
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
copySync(
|
copySync(
|
||||||
path.join(tempBinDir, `bun-${bunPlatform}`, 'bun'),
|
path.join(tempBinDir, `bun-${bunPlatform}`, 'bun'),
|
||||||
@ -156,12 +159,12 @@ async function main() {
|
|||||||
console.log('Bun downloaded.')
|
console.log('Bun downloaded.')
|
||||||
|
|
||||||
console.log(`Downloading UV for ${uvPlatform}...`)
|
console.log(`Downloading UV for ${uvPlatform}...`)
|
||||||
if (platform === 'win32') {
|
const uvExt = platform === 'win32' ? `zip` : `tar.gz`
|
||||||
await download(uvUrl, path.join(tempBinDir, `uv-${uvPlatform}.zip`))
|
const uvSaveDir = path.join(tempBinDir, `uv-${uvPlatform}.${uvExt}`)
|
||||||
} else {
|
if (!fs.existsSync(uvSaveDir)) {
|
||||||
await download(uvUrl, path.join(tempBinDir, `uv-${uvPlatform}.tar.gz`))
|
await download(uvUrl, uvSaveDir)
|
||||||
}
|
|
||||||
await decompress(uvPath, tempBinDir)
|
await decompress(uvPath, tempBinDir)
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
copySync(
|
copySync(
|
||||||
path.join(tempBinDir, `uv-${uvPlatform}`, 'uv'),
|
path.join(tempBinDir, `uv-${uvPlatform}`, 'uv'),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user